summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/events.result48
-rw-r--r--mysql-test/t/events.test32
2 files changed, 80 insertions, 0 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result
index 7ac29568bf8..cba1685ef32 100644
--- a/mysql-test/r/events.result
+++ b/mysql-test/r/events.result
@@ -37,6 +37,54 @@ alter event event3 rename to event2;
drop event event2;
create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end;
drop event event2;
+CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1;
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+0 1
+ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02';
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+1 1
+ALTER EVENT event_starts_test COMMENT "non-empty comment";
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+1 1 non-empty comment
+ALTER EVENT event_starts_test COMMENT "";
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost ONE TIME 2020-02-02 17:00:02 NULL NULL # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+1 1
+DROP EVENT event_starts_test;
+CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2;
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+0 0
+ALTER EVENT event_starts_test COMMENT "non-empty comment";
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+starts IS NULL ends IS NULL comment
+0 0 non-empty comment
+ALTER EVENT event_starts_test COMMENT "";
+SHOW EVENTS;
+Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
+events_test event_starts_test root@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
+DROP EVENT event_starts_test;
create event e_43 on schedule every 1 second do set @a = 5;
set global event_scheduler = 1;
alter event e_43 do alter event e_43 do set @a = 4;
diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test
index bde8747a4ef..a261b3c0c11 100644
--- a/mysql-test/t/events.test
+++ b/mysql-test/t/events.test
@@ -48,6 +48,38 @@ drop event event2;
create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end;
drop event event2;
+# BUG #16537 (Events: mysql.event.starts is null)
+CREATE EVENT event_starts_test ON SCHEDULE EVERY 10 SECOND COMMENT "" DO SELECT 1;
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+ALTER EVENT event_starts_test ON SCHEDULE AT '2020-02-02 20:00:02';
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+ALTER EVENT event_starts_test COMMENT "non-empty comment";
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+ALTER EVENT event_starts_test COMMENT "";
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+DROP EVENT event_starts_test;
+CREATE EVENT event_starts_test ON SCHEDULE EVERY 20 SECOND STARTS '2020-02-02 20:00:02' ENDS '2022-02-02 20:00:02' DO SELECT 2;
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+ALTER EVENT event_starts_test COMMENT "non-empty comment";
+--replace_column 8 # 9 #
+SHOW EVENTS;
+SELECT starts IS NULL, ends IS NULL, comment FROM mysql.event WHERE db='events_test' AND name='event_starts_test';
+ALTER EVENT event_starts_test COMMENT "";
+--replace_column 8 # 9 #
+SHOW EVENTS;
+DROP EVENT event_starts_test;
+#
+#
create event e_43 on schedule every 1 second do set @a = 5;
set global event_scheduler = 1;
--sleep 2