summaryrefslogtreecommitdiff
path: root/mysql-test/t/events_bugs.test
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2006-06-29 11:53:51 +0200
committerunknown <andrey@lmy004.>2006-06-29 11:53:51 +0200
commit8d961c45e2e83f04da92cbfc31d2975a6949743f (patch)
treea00b31b4c212c2306f408dd4bfd8a98df08b3d82 /mysql-test/t/events_bugs.test
parent9fa9378b2e5713250e1262879c7bc4d999e1bb40 (diff)
downloadmariadb-git-8d961c45e2e83f04da92cbfc31d2975a6949743f.tar.gz
fix for bug#16394 "Events: Crash if schedule contains SELECT"
Parsing of CREATE/ALTER EVENT statement was crashing because of early initialization done during parsing, instead in the after parsing phase. Moreover, we don't want SUBqueries in CREATE/ALTER EVENT therefore we disable them, though it is possible to make them work. It can be emulated inside SP with a cursor and SP variable (CREATE/ALTER EVENT can still accept variables as values). mysql-test/r/events_bugs.result: update result mysql-test/t/events_bugs.test: tests for bug#16384 sql/sql_yacc.yy: disallow subqueries when SQLCOM_CREATE_EVENT | SQLCOM_ALTER_EVENT The fix is not big, though lex->forbid_subqueries could have been introduced. Easier is just to set the sql_command and check in both rules where subqueries enter.
Diffstat (limited to 'mysql-test/t/events_bugs.test')
-rw-r--r--mysql-test/t/events_bugs.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index e07707e7734..4ff114555ca 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -198,4 +198,19 @@ drop database mysqltest_db1;
# END - 18897: Events: unauthorized action possible with alter event rename
#
+#
+# START - BUG#16394: Events: Crash if schedule contains SELECT
+#
+--error ER_PARSE_ERROR
+create event e_53 on schedule at (select s1 from ttx) do drop table t;
+--error ER_PARSE_ERROR
+create event e_53 on schedule every (select s1 from ttx) second do drop table t;
+--error ER_PARSE_ERROR
+create event e_53 on schedule every 5 second starts (select s1 from ttx) do drop table t;
+--error ER_PARSE_ERROR
+create event e_53 on schedule every 5 second ends (select s1 from ttx) do drop table t;
+#
+# END - BUG#16394: Events: Crash if schedule contains SELECT
+#
+
drop database events_test;