summaryrefslogtreecommitdiff
path: root/mysql-test/t/events_bugs.test
diff options
context:
space:
mode:
authorandrey@whirlpool.mysql.com <>2007-05-25 14:46:22 +0200
committerandrey@whirlpool.mysql.com <>2007-05-25 14:46:22 +0200
commit47c0c5a0eec7be0f28fbdac421162f440539500d (patch)
treebf4282c34507e2b9d02fecffe3a179e4c664a604 /mysql-test/t/events_bugs.test
parent7db7a83f945a42fb68d28d77e7c8d9c9c7ade0a7 (diff)
downloadmariadb-git-47c0c5a0eec7be0f28fbdac421162f440539500d.tar.gz
Fix for bug#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
A missing check for zero value of interval was added.
Diffstat (limited to 'mysql-test/t/events_bugs.test')
-rw-r--r--mysql-test/t/events_bugs.test38
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index b2c44da7f99..5bd8ae67fb1 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -610,6 +610,44 @@ 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
#