summaryrefslogtreecommitdiff
path: root/mysql-test/r/events_scheduling.result
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@sun.com>2010-01-06 15:00:51 +0100
committerTor Didriksen <tor.didriksen@sun.com>2010-01-06 15:00:51 +0100
commit986467900a2fbaa4cba005c86560045d4bf8b56f (patch)
tree5f822cbd6e51a3152056d59856647d0bd896774d /mysql-test/r/events_scheduling.result
parent16b991b8af518fea11fb4862bee89dcebecba9d4 (diff)
downloadmariadb-git-986467900a2fbaa4cba005c86560045d4bf8b56f.tar.gz
Bug #50087 Interval arithmetic for Event_queue_element is not portable.
Subtraction of two unsigned months yielded a (very large) positive value. Conversion of this to a signed value was not necessarily well defined. Solution: do the subtraction on signed values. mysql-test/r/events_scheduling.result: Add test case. mysql-test/t/events_scheduling.test: Add test case. sql/event_data_objects.cc: Convert month to signed before doing the subtraction.
Diffstat (limited to 'mysql-test/r/events_scheduling.result')
-rw-r--r--mysql-test/r/events_scheduling.result19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result
index 7dfd10a53f8..262caea3d7f 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -82,5 +82,24 @@ DROP TABLE table_1;
DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
+
+Bug #50087 Interval arithmetic for Event_queue_element is not portable.
+
+CREATE TABLE t1(a int);
+CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW() - INTERVAL 1 MONTH
+ENDS NOW() + INTERVAL 2 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW()
+ENDS NOW() + INTERVAL 11 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+DROP EVENT e1;
+DROP EVENT e2;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=@event_scheduler;