diff options
author | unknown <andrey@lmy004.> | 2006-02-28 11:43:10 +0100 |
---|---|---|
committer | unknown <andrey@lmy004.> | 2006-02-28 11:43:10 +0100 |
commit | 317c6851ba4acc75550f03e765de3a0eb1837ed0 (patch) | |
tree | 4e074ceb8afe49ab1398b1165020e45301d4282d /mysql-test/r/events.result | |
parent | b9d41f5d1b05ee5c7b12a53e49a09b150ad45de6 (diff) | |
download | mariadb-git-317c6851ba4acc75550f03e765de3a0eb1837ed0.tar.gz |
fix for bug#16537 (Events: mysql.event.starts is null)
- now when the event is created and STARTS is omitted then STARTS is implicitly
CURRENT_TIMESTAMP
- This CS also fixed incorrect presentation of STARTS/ENDS in I_S.EVENTS
(incorporated review changes)
mysql-test/r/events.result:
results of new test cases
mysql-test/t/events.test:
new test cases for bug #16537 (Events: mysql.event.starts is null)
sql/event.cc:
- check whether event_timed::starts_null only in case
event_timed::expression is set, so for recurring events only
- disable binlogging of CREATE EVENT statement. It should not be
replicated but the result of the execution. Still the replication is
untouched topic.
sql/event.h:
- add flags whether starts, ends and execute_at are null or not
sql/event_executor.cc:
- check whether xxx_null instead of !xxxx.year
sql/event_timed.cc:
- introduce xxx_null and change the usage of xxx.year to !xxx_null
sql/sql_show.cc:
- don't show 0000-00-00 in I_S.EVENTS when the value is NULL
sql/sql_yacc.yy:
- if STARTS is omitted default to current_timestamp
Diffstat (limited to 'mysql-test/r/events.result')
-rw-r--r-- | mysql-test/r/events.result | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index 41f944ab089..4aedf1f57af 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -13,6 +13,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; select sleep(2); @@ -64,7 +112,7 @@ SHOW GRANTS; Grants for ev_test@localhost GRANT USAGE ON *.* TO 'ev_test'@'localhost' GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost' -GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `events_test2`.* TO 'ev_test'@'localhost' +GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER ON `events_test2`.* TO 'ev_test'@'localhost' "Here comes an error:"; SHOW EVENTS; ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2' |