summaryrefslogtreecommitdiff
path: root/sql/events.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/events.cc')
-rw-r--r--sql/events.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/events.cc b/sql/events.cc
index 68e013adfae..f4400abdeb5 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -832,13 +832,12 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */)
*/
if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS)
{
- DBUG_ASSERT(thd->lex->first_select_lex()->db.str);
- if (!is_infoschema_db(&thd->lex->first_select_lex()->db) && // There is no events in I_S
- check_access(thd, EVENT_ACL, thd->lex->first_select_lex()->db.str,
- NULL, NULL, 0, 0))
+ LEX_CSTRING *lexdb= &thd->lex->first_select_lex()->db;
+ DBUG_ASSERT(lexdb);
+ if (!is_infoschema_db(lexdb) && !is_perfschema_db(lexdb) &&
+ check_access(thd, EVENT_ACL, lexdb->str, NULL, NULL, 0, 0))
DBUG_RETURN(1);
- db= normalize_db_name(thd->lex->first_select_lex()->db.str,
- db_tmp, sizeof(db_tmp));
+ db= normalize_db_name(lexdb->str, db_tmp, sizeof(db_tmp));
}
ret= db_repository->fill_schema_events(thd, tables, db);