summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorandrey@lmy004. <>2006-06-26 08:55:49 +0200
committerandrey@lmy004. <>2006-06-26 08:55:49 +0200
commitd617241c3f581ae96d64f6e9ea408b05e5fac678 (patch)
tree18022a7125d00345fe2dd101ae6d60c6523dbb48 /sql/sql_parse.cc
parentf25b7844b2412b21c46b20bb7e62f388c80bf178 (diff)
parente71ef73d538386227cc9e0d67f384648e1572d9e (diff)
downloadmariadb-git-d617241c3f581ae96d64f6e9ea408b05e5fac678.tar.gz
Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into lmy004.:/work/mysql-5.1-runtime-bug18897
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 5215ccfbbea..6e89b91ff4c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3824,7 +3824,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;
@@ -3832,7 +3834,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))