Bug #57156 ALTER EVENT changes the event status
Submitted: 30 Sep 2010 23:22 Modified: 21 Sep 2011 1:51
Reporter: Gary Pendergast Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1.48,5.1.51 OS:Any
Assigned to: Dmitry Shulga CPU Architecture:Any
Tags: events

[30 Sep 2010 23:22] Gary Pendergast
Description:
Running ALTER EVENT on an event can change the status of that event. May be related to the previously fixed Bug #31539.

How to repeat:
CREATE TABLE tbl_test(a int);
CREATE EVENT evt_test ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO INSERT INTO tbl_test(a) VALUES(1);
SHOW EVENTS\G
ALTER EVENT evt_test ON SCHEDULE EVERY 4 SECOND;
SHOW EVENTS\G

Output:

mysql [localhost] {msandbox} (test) > CREATE TABLE tbl_test(a int);
Query OK, 0 rows affected (0.01 sec)

mysql [localhost] {msandbox} (test) > CREATE EVENT evt_test ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO INSERT INTO tbl_test(a) VALUES(1);
Query OK, 0 rows affected (0.00 sec)

mysql [localhost] {msandbox} (test) > SHOW EVENTS\G
*************************** 1. row ***************************
                  Db: test
                Name: evt_test
             Definer: msandbox@%
           Time zone: SYSTEM
                Type: RECURRING
          Execute at: NULL
      Interval value: 3
      Interval field: SECOND
              Starts: 2010-10-01 01:19:05
                Ends: NULL
              Status: SLAVESIDE_DISABLED
          Originator: 0
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.00 sec)

mysql [localhost] {msandbox} (test) > ALTER EVENT evt_test ON SCHEDULE EVERY 4 SECOND;
Query OK, 0 rows affected (0.00 sec)

mysql [localhost] {msandbox} (test) > SHOW EVENTS\G
*************************** 1. row ***************************
                  Db: test
                Name: evt_test
             Definer: msandbox@%
           Time zone: SYSTEM
                Type: RECURRING
          Execute at: NULL
      Interval value: 4
      Interval field: SECOND
              Starts: 2010-10-01 01:19:05
                Ends: NULL
              Status: ENABLED
          Originator: 0
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.00 sec)

Suggested fix:
Status should remain in SLAVESIDE_DISABLED state unless specifically changed.
[21 Sep 2011 1:51] Paul DuBois
Noted in 5.1.58, 5.5.14, 5.6.3 changelogs.

ALTER EVENT could change the event status.