List:Commits« Previous MessageNext Message »
From:andrey Date:May 25 2007 2:46pm
Subject:bk commit into 5.1 tree (andrey:1.2515) BUG#28666
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of andrey. When andrey does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-25 14:46:22+02:00, andrey@stripped +3 -0
  Fix for bug#28666 CREATE EVENT ... EVERY 0 SECOND let server crash
  
  A missing check for zero value of interval was added.

  mysql-test/r/events_bugs.result@stripped, 2007-05-25 14:46:18+02:00,
andrey@stripped +29 -0
    update result file

  mysql-test/t/events_bugs.test@stripped, 2007-05-25 14:46:18+02:00,
andrey@stripped +38 -0
    add test case for bug#28666 CREATE EVENT ... EVERY 0 SECOND let server crash

  sql/event_data_objects.cc@stripped, 2007-05-25 14:46:18+02:00, andrey@stripped
+2 -1
    add a missing check about zero value for interval

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	andrey
# Host:	whirlpool.mysql.com
# Root:	/work/mysql-5.1-runtime

--- 1.31/mysql-test/r/events_bugs.result	2007-05-16 14:01:12 +02:00
+++ 1.32/mysql-test/r/events_bugs.result	2007-05-25 14:46:18 +02:00
@@ -528,4 +528,33 @@
 DROP EVENT e2;
 DROP EVENT e1;
 SET TIME_ZONE=@save_time_zone;
+drop event if exists new_event;
+CREATE EVENT new_event ON SCHEDULE EVERY 0 SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT 0) SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "abcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "0abcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY "a1bcdef" SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "abcdef" UNION SELECT "abcdef") SECOND
DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "0abcdef") SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE EVERY (SELECT "a1bcdef") SECOND DO SELECT 1;
+ERROR HY000: INTERVAL is either not positive or too big
+CREATE EVENT new_event ON SCHEDULE AT "every day" DO SELECT 1;
+ERROR HY000: Incorrect AT value: 'every day'
+CREATE EVENT new_event ON SCHEDULE AT "0every day" DO SELECT 1;
+ERROR HY000: Incorrect AT value: '0every day'
+CREATE EVENT new_event ON SCHEDULE AT (SELECT "every day") DO SELECT 1;
+ERROR HY000: Incorrect AT value: 'every day'
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'STARTS NOW() DO SELECT 1' at
line 1
+CREATE EVENT new_event ON SCHEDULE AT NOW() ENDS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'ENDS NOW() DO SELECT 1' at
line 1
+CREATE EVENT new_event ON SCHEDULE AT NOW() STARTS NOW() ENDS NOW() DO SELECT 1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'STARTS NOW() ENDS NOW() DO
SELECT 1' at line 1
 drop database events_test;

--- 1.28/mysql-test/t/events_bugs.test	2007-05-16 14:01:12 +02:00
+++ 1.29/mysql-test/t/events_bugs.test	2007-05-25 14:46:18 +02:00
@@ -610,6 +610,44 @@
 
 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
 #

--- 1.99/sql/event_data_objects.cc	2007-05-16 14:05:17 +02:00
+++ 1.100/sql/event_data_objects.cc	2007-05-25 14:46:18 +02:00
@@ -413,7 +413,8 @@
   default:
     ;/* these are the microsec stuff */
   }
-  if (interval_tmp.neg || expression > EVEX_MAX_INTERVAL_VALUE)
+  if (interval_tmp.neg || expression == 0 ||
+      expression > EVEX_MAX_INTERVAL_VALUE)
   {
     my_error(ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG, MYF(0));
     DBUG_RETURN(EVEX_BAD_PARAMS);
Thread
bk commit into 5.1 tree (andrey:1.2515) BUG#28666andrey25 May