Commit ff7e7fcb authored by unknown's avatar unknown

Bug#32775 problems with SHOW EVENTS and Information_Schema

removed unnecessary privilege checks for I_S schema


mysql-test/r/information_schema.result:
  test result
mysql-test/t/information_schema.test:
  test case
sql/events.cc:
  There is no events in I_S so we don't need to execute check_access here.
sql/sql_parse.cc:
  removed unnecessary check
parent f4a7464f
......@@ -1611,4 +1611,11 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
Warnings:
Note 1003 select 1 AS `1` from `information_schema`.`tables`
use information_schema;
show events;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
show events from information_schema;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
show events where Db= 'information_schema';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
End of 5.1 tests.
......@@ -1238,4 +1238,12 @@ select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
#
explain extended select 1 from information_schema.tables;
#
# Bug#32775 problems with SHOW EVENTS and Information_Schema
#
use information_schema;
show events;
show events from information_schema;
show events where Db= 'information_schema';
--echo End of 5.1 tests.
......@@ -825,8 +825,8 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS)
{
DBUG_ASSERT(thd->lex->select_lex.db);
if (check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0,
is_schema_db(thd->lex->select_lex.db)))
if (!is_schema_db(thd->lex->select_lex.db) && // There is no events in I_S
check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0, 0))
DBUG_RETURN(1);
db= thd->lex->select_lex.db;
}
......
......@@ -1855,10 +1855,6 @@ mysql_execute_command(THD *thd)
switch (lex->sql_command) {
case SQLCOM_SHOW_EVENTS:
if ((res= check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0,
is_schema_db(thd->lex->select_lex.db))))
break;
/* fall through */
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
res= execute_sqlcom_select(thd, all_tables);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment