diff options
author | unknown <andrey@lmy004.> | 2006-02-15 17:12:27 +0100 |
---|---|---|
committer | unknown <andrey@lmy004.> | 2006-02-15 17:12:27 +0100 |
commit | 2557f80fd1091c55873e1223638671b92d4274fb (patch) | |
tree | 9ed6fc16ec4ffe63119d291e56559b89f9210473 /sql | |
parent | 098ae02afa1d42024475e05442e8e530c0fbcf58 (diff) | |
download | mariadb-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.cc | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 |
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, |