summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-02-15 17:12:27 +0100
committerunknown <andrey@lmy004.>2006-02-15 17:12:27 +0100
commit2557f80fd1091c55873e1223638671b92d4274fb (patch)
tree9ed6fc16ec4ffe63119d291e56559b89f9210473 /sql
parent098ae02afa1d42024475e05442e8e530c0fbcf58 (diff)
downloadmariadb-git-2557f80fd1091c55873e1223638671b92d4274fb.tar.gz
fix for bug#16410 (Events: CREATE EVENT is legal in a CREATE TRIGGER statement)
WL#1034 (Internal CRON) (post-post-review updates) mysql-test/r/events.result: update results file mysql-test/t/events.test: add test for Bug #16410 Events: CREATE EVENT is legal in a CREATE TRIGGER statement sql/sp_head.cc: CREATE/ALTER/DROP event mean explicit commit, so they are not allowed in a FUNCTION/TRIGGER. Fixes bug#16410 sql/sql_parse.cc: - end active transaction for CREATE/ALTER/DROP EVENT because they are DDL statements.
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_head.cc3
-rw-r--r--sql/sql_parse.cc6
2 files changed, 9 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index cf1097a28c6..301d88c8775 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -255,6 +255,9 @@ sp_get_flags_for_command(LEX *lex)
case SQLCOM_ALTER_FUNCTION:
case SQLCOM_DROP_PROCEDURE:
case SQLCOM_DROP_FUNCTION:
+ case SQLCOM_CREATE_EVENT:
+ case SQLCOM_ALTER_EVENT:
+ case SQLCOM_DROP_EVENT:
flags= sp_head::HAS_COMMIT_OR_ROLLBACK;
break;
default:
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index a061ff3730b..b84eb1cfcb8 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3773,6 +3773,12 @@ end_with_restore_list:
is_schema_db(lex->et->dbname.str)))
break;
+ if (end_active_trans(thd))
+ {
+ res= -1;
+ break;
+ }
+
switch (lex->sql_command) {
case SQLCOM_CREATE_EVENT:
res= evex_create_event(thd, lex->et, (uint) lex->create_info.options,