Bug #32775 problems with SHOW EVENTS and Information_Schema
Submitted: 27 Nov 2007 15:29 Modified: 21 Dec 2007 16:38
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.22 OS:Any
Assigned to: Sergei Glukhov CPU Architecture:Any
Tags: qc

[27 Nov 2007 15:29] Peter Laursen
Description:
If I_S is the current database context SHOW EVENTS fails 

maybe related: http://bugs.mysql.com/bug.php?id=31302

How to repeat:
use information_schema;
show events;
/*
returns

Error Code : 1044
Access denied for user 'root'@'localhost' to database 'information_schema'
*/

use mysql;
show events; -- it works!

-- also note this weird behaviour

use information_schema;
show events from information_schema;
/*
returns

Error Code : 1044
Access denied for user 'root'@'localhost' to database 'information_schema'

but this should be a 1064 syntax error I think!
.. you do not SHOW ... FROM ...
*/

Suggested fix:
no precise idea!
[27 Nov 2007 20:07] MySQL Verification Team
Thank you for the bug report.

[miguel@skybr 5.1]$ bin/mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.23-rc-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show events;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show events;
Empty set (0.00 sec)
[30 Nov 2007 11:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38948

ChangeSet@1.2667, 2007-11-30 15:29:59+04:00, gluh@mysql.com +4 -0
  Bug#32775 problems with SHOW EVENTS and Information_Schema
  removed unnecessary privilege checks for I_S schema
[30 Nov 2007 14:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/38975

ChangeSet@1.2658, 2007-11-30 18:48:22+04:00, gluh@mysql.com +4 -0
  Bug#32775 problems with SHOW EVENTS and Information_Schema
  removed unnecessary privilege checks for I_S schema
[14 Dec 2007 8:18] Bugs System
Pushed into 5.1.23-rc
[14 Dec 2007 8:21] Bugs System
Pushed into 6.0.5-alpha
[21 Dec 2007 16:38] Paul DuBois
Noted in 5.1.23, 6.0.5 changelogs.

SHOW EVENTS and selecting from the INFORMATION_SCHEMA.EVENTS table
failed if the current database was INFORMATION_SCHEMA.