Bug #16548 Events: can't alter clause for preserve
Submitted: 16 Jan 2006 20:46 Modified: 26 Jan 2006 2:35
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 (SUSE 10.0)
Assigned to: Andrey Hristov CPU Architecture:Any

[16 Jan 2006 20:46] Peter Gulutzan
Description:
ALTER EVENT ... ON SCHEDULE ... ON COMPLETION [NOT] PRESERVE
is okay.
ALTER EVENT ... ON COMPLETION [NOT] PRESERVE
(without ON SCHEDULE clause) causes a syntax error.

Preservation is not dependent on the schedule, so this is an error.

How to repeat:
mysql> create event db2.e_2 on schedule every 1 second on completion preserve do set @b=5;
Query OK, 1 row affected (0.00 sec)

mysql> alter event db2.e_2 on schedule every 1 second on completion preserve do set @b=5;
Query OK, 1 row affected (0.00 sec)

mysql> alter event db2.e_2 on schedule every 1 second on completion preserve;
Query OK, 1 row affected (0.00 sec)

mysql> alter event db2.e_2 on completion preserve;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'completion preserve' at line 1
[16 Jan 2006 23:10] MySQL Verification Team
mysql> alter event db2.e_2 on schedule every 1 second on completion preserve;
Query OK, 1 row affected (0.00 sec)

mysql> alter event db2.e_2 on completion preserve;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'completion preserve' at line 1
[20 Jan 2006 15:14] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/1403
[23 Jan 2006 14:10] Andrey Hristov
Fixed in 5.1.6, the bug is from unreleased version (probably does not need documenting in the Changelog).
[26 Jan 2006 2:35] Mike Hillyer
Documented in 5.1.6 changelog:

<listitem>
        <para>
          <literal>CREATE EVENT</literal> statement with <literal>ON
            COMPLETION</literal> clause but no <literal>ON
              SCHEDULE</literal> clause resulted in syntax error. (Bug
          #16548)
        </para>
      </listitem>