Description:
CREATE EVENT does not clear warnings generated by a previous statement.
How to repeat:
Test script:
-- make sure that the event doesn't exist
DROP EVENT IF EXISTS myevent;
-- this should generate a warning that the event doesn't exist
DROP EVENT IF EXISTS myevent;
-- display the warning
SHOW WARNINGS;
-- create the event; no warning should occur
CREATE EVENT myevent ON SCHEDULE EVERY 15 SECOND DO SET @x = 1;
-- this displays the warning that the event doesn't exist,
-- but it was just created, with no warnings!
SHOW WARNINGS;
-- prove that the event exists
SHOW CREATE EVENT myevent\G
Result of running the script:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 29
Server version: 5.1.24-rc-debug-log
mysql> -- make sure that the event doesn't exist
mysql> DROP EVENT IF EXISTS myevent;
Query OK, 0 rows affected (0.12 sec)
mysql> -- this should generate a warning that the event doesn't exist
mysql> DROP EVENT IF EXISTS myevent;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> -- display the warning
mysql> SHOW WARNINGS;
+-------+------+------------------------------+
| Level | Code | Message |
+-------+------+------------------------------+
| Note | 1305 | Event myevent does not exist |
+-------+------+------------------------------+
1 row in set (0.01 sec)
mysql> -- create the event; no warning should occur
mysql> CREATE EVENT myevent ON SCHEDULE EVERY 15 SECOND DO SET @x = 1;
Query OK, 0 rows affected (0.03 sec)
mysql> -- this displays the warning that the event doesn't exist,
mysql> -- but it was just created, with no warnings!
mysql> SHOW WARNINGS;
+-------+------+------------------------------+
| Level | Code | Message |
+-------+------+------------------------------+
| Note | 1305 | Event myevent does not exist |
+-------+------+------------------------------+
1 row in set (0.03 sec)
mysql> -- prove that the event exists
mysql> SHOW CREATE EVENT myevent\G
*************************** 1. row ***************************
Event: myevent
sql_mode:
time_zone: SYSTEM
Create Event: CREATE EVENT `myevent` ON SCHEDULE EVERY 15 SECOND STARTS '2008-03-14 10:59:46' ON COMPLETION NOT PRESERVE ENABLE DO SET @x = 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
Database Collation: latin1_swedish_ci
1 row in set (0.01 sec)