Bug #16395 Events: CREATE EVENT failure only causes a warning
Submitted: 12 Jan 2006 3:32 Modified: 2 Feb 2006 5:09
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.6-alpha-debug OS:Linux (linux)
Assigned to: Andrey Hristov CPU Architecture:Any

[12 Jan 2006 3:32] Peter Gulutzan
Description:
If I say "CREATE TABLE t" and t already exists,
I get an error.
But if I say "CREATE EVENT e" and e already exists,
I only get a warning.

How to repeat:
mysql> delimiter //
mysql> set sql_mode=traditional//
Query OK, 0 rows affected (0.00 sec)

mysql> create event e_54 on schedule every 1 second do begin end//
Query OK, 1 row affected (0.00 sec)

mysql> create event e_54 on schedule every 1 second do begin end//
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> show warnings//
+-------+------+----------------------------+
| Level | Code | Message                    |
+-------+------+----------------------------+
| Note  | 1511 | Event 'e_1' already exists |
+-------+------+----------------------------+
1 row in set (0.00 sec)
[27 Jan 2006 12:27] Andrey Hristov
Fixed in 5.1.6 

The patch went the the fix for another bug report.

mysql> create event three_event on schedule every 20 second do select 123;
Query OK, 1 row affected (0.04 sec)

mysql> create event three_event on schedule every 20 second do select 123;
ERROR 1515 (HY000): Event 'three_event' already exists
[2 Feb 2006 5:09] Mike Hillyer
Documented in 5.1.6 changelog:

     <listitem>
        <para>
          Warning upgraded to error for <literal>CREATE EVENT</literal>
          where event already exists. (Bug #16395) 
        </para>
      </listitem>