summaryrefslogtreecommitdiff
path: root/mysql-test/t/events_bugs.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/events_bugs.test')
-rw-r--r--mysql-test/t/events_bugs.test48
1 files changed, 47 insertions, 1 deletions
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index b2c44da7f99..f369fbecd66 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -610,7 +610,53 @@ DROP EVENT e1;
SET TIME_ZONE=@save_time_zone;
+#
+# START - BUG#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
+#
+--disable_warnings
+drop event if exists new_event;
+--enable_warnings
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT 0) SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "abcdef" SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "0abcdef" SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY "a1bcdef" SECOND DO SELECT 1;
+
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "abcdef" UNION SELECT "abcdef") SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "0abcdef") SECOND DO SELECT 1;
+--error ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "a1bcdef") SECOND DO SELECT 1;
+
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT "every day" DO SELECT 1;
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT "0every day" DO SELECT 1;
+--error ER_WRONG_VALUE
+CREATE EVENT new_event ON SCHEDULE AT (SELECT "every day") DO SELECT 1;
+
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() DO SELECT 1;
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
+--error ER_PARSE_ERROR
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
+
+
+
#
# End of tests
#
-drop database events_test;
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where db='events_test' and command = 'Connect' and user=current_user();
+--source include/wait_condition.inc
+
+DROP DATABASE events_test;