diff options
-rw-r--r-- | mysql-test/r/information_schema.result | 7 | ||||
-rw-r--r-- | mysql-test/t/information_schema.test | 8 | ||||
-rw-r--r-- | sql/events.cc | 4 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 |
4 files changed, 17 insertions, 6 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 4df3b56da86..a2c337e00df 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -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. diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 2dd19a94758..0d53c404fa9 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -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. diff --git a/sql/events.cc b/sql/events.cc index 262c62bdbc8..4579fb4d086 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -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; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9f510f9b33c..7a777ba2bbd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -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); |