summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ea4eea19e34..d2d32caa7c8 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -26,7 +26,8 @@
#include "sp_head.h"
#include "sp.h"
#include "sp_cache.h"
-#include "event.h"
+#include "events.h"
+#include "event_timed.h"
#ifdef HAVE_OPENSSL
/*
@@ -3835,7 +3836,9 @@ end_with_restore_list:
uint rows_affected= 1;
DBUG_ASSERT(lex->et);
do {
- if (! lex->et->dbname.str)
+ if (! lex->et->dbname.str ||
+ (lex->sql_command == SQLCOM_ALTER_EVENT && lex->spname &&
+ !lex->spname->m_db.str))
{
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
res= true;
@@ -3843,7 +3846,10 @@ end_with_restore_list:
}
if (check_access(thd, EVENT_ACL, lex->et->dbname.str, 0, 0, 0,
- is_schema_db(lex->et->dbname.str)))
+ is_schema_db(lex->et->dbname.str)) ||
+ (lex->sql_command == SQLCOM_ALTER_EVENT && lex->spname &&
+ (check_access(thd, EVENT_ACL, lex->spname->m_db.str, 0, 0, 0,
+ is_schema_db(lex->spname->m_db.str)))))
break;
if (end_active_trans(thd))