Bug #27407 Events: altering changes 'on completion preserve'
Submitted: 23 Mar 2007 19:26 Modified: 11 Dec 2007 20:15
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.18-beta-debug OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: Damien Katz CPU Architecture:Any

[23 Mar 2007 19:26] Peter Gulutzan
Description:
The MySQL Reference Manual says, concerning ALTER EVENT options:
"... options which are omitted retain their existing values".
http://dev.mysql.com/doc/refman/5.1/en/alter-event.html

But, although I omit ON COMPLETION NOT PRESERVE clause in an
ALTER EVENT statement, the on_completion value changes from
PRESERVE to NOT PRESERVE.

How to repeat:
mysql> set global event_scheduler = 0;
Query OK, 0 rows affected (0.01 sec)

mysql> create event e3 on schedule at current_timestamp on completion preserve disable do set @a=5;
Query OK, 0 rows affected (0.00 sec)

mysql> select event_name,on_completion from information_schema.events;
+------------+---------------+
| event_name | on_completion |
+------------+---------------+
| e3         | PRESERVE      |
+------------+---------------+
1 row in set (0.01 sec)

mysql> alter event e3 enable;
Query OK, 0 rows affected (0.00 sec)

mysql> select event_name,on_completion from information_schema.events;
+------------+---------------+
| event_name | on_completion |
+------------+---------------+
| e3         | NOT PRESERVE  |
+------------+---------------+
1 row in set (0.01 sec)
[26 Mar 2007 9:22] Sveta Smirnova
Thank you for the report.

Verified as described.
[12 Oct 2007 7:21] Brian Aker
Wrong result, the priority is too low.
[14 Nov 2007 21:25] Damien Katz
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/35877

ChangeSet@1.2589, 2007-10-18 19:51:30-04:00, dkatz@damien-katzs-computer.local +6 -0
  Bug#31539 ALTER EVENT RENAME TO... resets STATUS to 'ENABLED
  Bug#27407 Events: altering changes 'on completion preserve'
  
  To fix bugs with "alter events", added "changed" flags to Event_parse_data, so we can
tell if a completion or status value has been explicitly stated in the SQL, or if it's the
default settings.
[14 Nov 2007 21:26] Damien Katz
patch pushed to 5.1-runtime
[6 Dec 2007 11:11] Konstantin Osipov
Pushed into 5.1.23
[11 Dec 2007 20:15] Paul DuBois
Noted in 5.1.23 changelog.

For an event with an ON COMPLETION value of PRESERVE, an ALTER EVENT
statement that specified no ON COMPLETION option caused the value to
become NOT PRESERVE.