Bug #29768 ALTER EVENT .. RENAME TO .. drops the event if event_scheduler is ON
Submitted: 12 Jul 2007 18:26 Modified: 16 Feb 2008 11:14
Reporter: Santo Leto Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S2 (Serious)
Version:5.1.20-beta, 5.1.23-rc OS:Windows (XPSP2)
Assigned to: CPU Architecture:Any
Tags: ALTER EVENT, rename event

[12 Jul 2007 18:26] Santo Leto
Description:
ALTER EVENT .. RENAME TO .. drops the event if event_scheduler is ON

How to repeat:
mysql>DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected (0.00 sec)

mysql>CREATE DATABASE event_test;
Query OK, 1 row affected (0.00 sec)

mysql>USE event_test;
Database changed
mysql> 
mysql>SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.02 sec)

mysql> 
mysql>delimiter $$
mysql>   	
mysql>CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
    ->BEGIN
    ->	#do nothing
    ->END$$
Query OK, 0 rows affected (0.00 sec)

mysql> 	
mysql>delimiter ;
mysql> 	
mysql>SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
            Db: event_test
          Name: at_event
       Definer: root@localhost
     Time zone: SYSTEM
          Type: ONE TIME
    Execute at: 2007-07-12 20:18:35
Interval value: NULL
Interval field: NULL
        Starts: NULL
          Ends: NULL
        Status: ENABLED
    Originator: 1
1 row in set (0.01 sec)

mysql> 
mysql>SET GLOBAL event_scheduler='ON';
Query OK, 0 rows affected (0.02 sec)

mysql> 
mysql>ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> 
mysql>SHOW EVENTS FROM `event_test`\G
Empty set (0.01 sec)

mysql> 			
mysql>#--> where is the event?
mysql>
[12 Jul 2007 19:33] MySQL Verification Team
Thank you for the bug report.

[miguel@light 5.1]$ bin/mysql -uroot test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.21-beta-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.02 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter $$
mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT
    -> CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
    -> BEGIN
    ->  #do nothing
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2007-07-12 16:23:19
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                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.01 sec)

mysql> SET GLOBAL event_scheduler='ON';
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
Empty set (0.00 sec)

mysql> DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.00 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter $$
mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT
    -> CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
    -> BEGIN
    ->  #do nothing
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2007-07-12 16:24:48
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                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)

mysql> #SET GLOBAL event_scheduler='ON';
mysql> ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event2
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2007-07-12 16:24:48
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                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)

Version: '5.1.21-beta-debug'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
070712 16:23:19 [Note] Event Scheduler: scheduler thread started with id 2
070712 16:23:19 [Note] Event Scheduler: Last execution of event_test.at_event. 
070712 16:23:19 [Note] Event Scheduler: [root@localhost].[event_test.at_event] started in thread 3.
070712 16:23:19 [Note] Event Scheduler: [root@localhost].[event_test.at_event] executed successfully in thread 3.
070712 16:23:19 [Note] Event Scheduler: Last execution of event_test.at_event2. Dropping.
070712 16:23:19 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] started in thread 4.
070712 16:23:19 [Note] Event Scheduler: Dropping event_test.at_event2
070712 16:23:19 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] executed successfully in thread 4.
070712 16:24:48 [Note] Event Scheduler: Killing the scheduler thread, thread id 2
070712 16:24:48 [Note] Event Scheduler: Waiting for the scheduler thread to reply
070712 16:24:48 [Note] Event Scheduler: Stopped
[12 Jul 2007 19:39] MySQL Verification Team
DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
delimiter $$
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT
CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
BEGIN
 #do nothing
END$$
delimiter ;
SHOW EVENTS FROM `event_test`\G
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`\G
[19 Oct 2007 19:17] Damien Katz
I cannot reproduce this with the latest builds. Checking around.
[22 Oct 2007 17:54] Damien Katz
I don't see the event getting dropped. I've tested with 5.1.23-beta and 5.2.6-alpha. here is the exact test script I am running:

DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO BEGIN END;
SHOW EVENTS FROM `event_test`;
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`;

And here is the results with 5.1.23-beta:

DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO BEGIN END;
SHOW EVENTS FROM `event_test`;
Db	Name	Definer	Time zone	Type	Execute at	Interval value	Interval field	Starts	Ends	Status	Originator	character_set_client	collation_connection	Database Collation
event_test	at_event	root@localhost	SYSTEM	ONE TIME	2007-10-22 20:48:04	NULL	NULL	NULL	NULL	ENABLED	1	latin1	latin1_swedish_ci	latin1_swedish_ci
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`;
Db	Name	Definer	Time zone	Type	Execute at	Interval value	Interval field	Starts	Ends	Status	Originator	character_set_client	collation_connection	Database Collation
event_test	at_event2	root@localhost	SYSTEM	ONE TIME	2007-10-22 20:48:04	NULL	NULL	NULL	NULL	DISABLED	1	latin1	latin1_swedish_ci	latin1_swedish_ci
DROP DATABASE IF EXISTS event_test;

I will pull a 5.1.22-rc source tree and see if I can reproduce there.
[22 Oct 2007 18:56] Damien Katz
I get the same results with 5.1.22-rc.
[23 Oct 2007 9:03] Santo Leto
Damien,

JFYI, If I add a + INTERVAL 1 YEAR clause, I don't see the event getting dropped, too.

Miguel, please, could you take a minute to understand what is happening?
Thank you, Santo.

## Test Script:

DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON
SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO BEGIN
END;
SHOW EVENTS FROM `event_test`\G
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO
`event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`\G

## MySQL output:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.22-rc-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected (0.11 sec)

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.02 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON
    -> SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO BEGIN
    -> END;
Query OK, 0 rows affected (0.08 sec)

mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2007-10-23 10:14:13
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.01 sec)

mysql> SET GLOBAL event_scheduler='ON';
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER EVENT `event_test`.`at_event` RENAME TO
    -> `event_test`.`at_event2`;
Query OK, 0 rows affected (0.02 sec)

mysql> SHOW EVENTS FROM `event_test`\G
Empty set (0.01 sec)

mysql>

## Error Log

071023 10:12:54  InnoDB: Started; log sequence number 0 46409
071023 10:12:55 [Note] Event Scheduler: Loaded 0 events
071023 10:12:55 [Note] mysqld: ready for connections.
Version: '5.1.22-rc-community-log'  socket: ''  port: 5122  MySQL Community Server (GPL)
071023 10:14:13 [Note] Event Scheduler: scheduler thread started with id 4
071023 10:14:13 [Note] Event Scheduler: Last execution of event_test.at_event2. Dropping.
071023 10:14:13 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] started in thread 5.
071023 10:14:13 [Note] Event Scheduler: Dropping event_test.at_event2
071023 10:14:13 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] executed successfully in thread 5.

## Error Log with extra debug Info

C:\Programmi\MySQL\mysql-5.1.22-rc-win32\bin>mysqladmin debug -uroot -p -P5122
Enter password:

Status information:

Current dir: C:\Programmi\MySQL\mysql-5.1.22-rc-win32\data\
Running threads: 5  Stack size: 131072
Current locks:
lock: 0x25f3c84:

lock: 0x2ed029c:

lock: 0x25e18d4:

lock: 0x12e805c:

Key caches:
default
Buffer_size:         16384
Block_size:           1024
Division_limit:        100
Age_limit:             300
blocks used:             2
not flushed:             0
w_requests:             12
writes:                  6
r_requests:             30
reads:                   2

handler status:
read_key:           11
read_next:           1
read_rnd             0
read_first:          3
write:            1032
delete               1
update:              2

Table status:
Opened tables:         22
Open tables:            4
Open files:            10
Open streams:           0

Alarm status:
Active alarms:   0
Max used alarms: 0
Next alarm time: 0

## Test Script 2:

We add a + INTERVAL 1 YEAR clause:

DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON
SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 YEAR ON COMPLETION PRESERVE ENABLE DO BEGIN
END;
SHOW EVENTS FROM `event_test`\G
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`\G

## MySQL Output 2:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.22-rc-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected (0.05 sec)

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.03 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON
    -> SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 YEAR ON COMPLETION PRESERVE EN
ABLE DO BEGIN
    -> END;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2008-10-23 10:44:49
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.02 sec)

mysql> SET GLOBAL event_scheduler='ON';
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event2
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2008-10-23 10:44:49
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.00 sec)

mysql>

## Error Log:

071023 10:43:46  InnoDB: Started; log sequence number 0 46419
071023 10:43:46 [Note] Event Scheduler: Loaded 1 event
071023 10:43:46 [Note] mysqld: ready for connections.
Version: '5.1.22-rc-community-log'  socket: ''  port: 5122  MySQL Community Server (GPL)
071023 10:44:49 [Note] Event Scheduler: scheduler thread started with id 4

## Error Log with extra debug Info

Status information:

Current dir: C:\Programmi\MySQL\mysql-5.1.22-rc-win32\data\
Running threads: 5  Stack size: 131072
Current locks:
lock: 0x25e125c:

lock: 0x2600754:

lock: 0x260290c:

lock: 0x25f9c3c:

Key caches:
default
Buffer_size:         16384
Block_size:           1024
Division_limit:        100
Age_limit:             300
blocks used:             2
not flushed:             0
w_requests:             12
writes:                  6
r_requests:             26
reads:                   2

handler status:
read_key:            8
read_next:           2
read_rnd             0
read_first:          3
write:             325
delete               1
update:              1

Table status:
Opened tables:         22
Open tables:            4
Open files:            10
Open streams:           0

Alarm status:
Active alarms:   0
Max used alarms: 0
Next alarm time: 0
[16 Feb 2008 11:14] Santo Leto
DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
delimiter $$
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT
CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
BEGIN
 #do nothing
END$$
delimiter ;
SHOW EVENTS FROM `event_test`\G
SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`\G

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.23-rc-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.00 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter $$
mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCH
EDULE AT
    -> CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO
    -> BEGIN
    ->  #do nothing
    -> END$$
Query OK, 0 rows affected (0.01 sec)

mysql> delimiter ;
mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2008-02-16 11:58:42
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.02 sec)

mysql> SET GLOBAL event_scheduler='ON';
Query OK, 0 rows affected (0.00 sec)

mysql> ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
Empty set (0.00 sec)

Error Log:

InnoDB: The first specified data file .\ibdata1 did not exist:
InnoDB: a new database to be created!
080216 11:45:08  InnoDB: Setting file .\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080216 11:45:09  InnoDB: Log file .\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080216 11:45:09  InnoDB: Log file .\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file .\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080216 11:45:10  InnoDB: Started; log sequence number 0 0
080216 11:45:53 [Note] Event Scheduler: Loaded 0 events
080216 11:45:53 [Note] mysqld: ready for connections.
Version: '5.1.23-rc-community-log'  socket: ''  port: 5123  MySQL Community Server (GPL)
080216 11:58:42 [Note] Event Scheduler: scheduler thread started with id 12
080216 11:58:42 [Note] Event Scheduler: Last execution of event_test.at_event. 
080216 11:58:42 [Note] Event Scheduler: Last execution of event_test.at_event2. Dropping.
080216 11:58:42 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] started in thread 14.
080216 11:58:42 [Note] Event Scheduler: Dropping event_test.at_event2
080216 11:58:42 [Note] Event Scheduler: [root@localhost].[event_test.at_event2] executed successfully in thread 14.

Status information:

Current dir: X:\mysql\mysql-5.1.23-rc-win32\data\
Running threads: 7  Stack size: 131072
Current locks:
lock: 0x1307c7c:

lock: 0x2e40914:

lock: 0x25564ac:

lock: 0x2597244:

Key caches:
default
Buffer_size:         16384
Block_size:           1024
Division_limit:        100
Age_limit:             300
blocks used:             4
not flushed:             0
w_requests:             28
writes:                 22
r_requests:            118
reads:                  15

handler status:
read_key:           29
read_next:          67
read_rnd             6
read_first:         46
write:            4060
delete               1
update:              6

Table status:
Opened tables:        338
Open tables:            4
Open files:             9
Open streams:           0

Alarm status:
Active alarms:   0
Max used alarms: 0
Next alarm time: 0

DROP DATABASE IF EXISTS event_test;
CREATE DATABASE event_test;
USE event_test;
SET GLOBAL event_scheduler = 'OFF';
delimiter $$
CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCHEDULE AT
CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO 
BEGIN
 #do nothing
END$$
delimiter ;
SHOW EVENTS FROM `event_test`\G
## SET GLOBAL event_scheduler='ON';
ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
SHOW EVENTS FROM `event_test`\G

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.1.23-rc-community-log MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> DROP DATABASE IF EXISTS event_test;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE DATABASE event_test;
Query OK, 1 row affected (0.00 sec)

mysql> USE event_test;
Database changed
mysql> SET GLOBAL event_scheduler = 'OFF';
Query OK, 0 rows affected (0.01 sec)

mysql> delimiter $$
mysql> CREATE DEFINER = 'root'@'localhost' EVENT  `event_test`.`at_event` ON SCH
EDULE AT
    -> CURRENT_TIMESTAMP ON COMPLETION PRESERVE ENABLE DO
    -> BEGIN
    ->  #do nothing
    -> END$$
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;
mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2008-02-16 12:05:35
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.02 sec)

mysql> ## SET GLOBAL event_scheduler='ON';
mysql> ALTER EVENT `event_test`.`at_event` RENAME TO `event_test`.`at_event2`;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW EVENTS FROM `event_test`\G
*************************** 1. row ***************************
                  Db: event_test
                Name: at_event2
             Definer: root@localhost
           Time zone: SYSTEM
                Type: ONE TIME
          Execute at: 2008-02-16 12:05:35
      Interval value: NULL
      Interval field: NULL
              Starts: NULL
                Ends: NULL
              Status: ENABLED
          Originator: 1
character_set_client: latin1
collation_connection: latin1_swedish_ci
  Database Collation: latin1_swedish_ci
1 row in set (0.01 sec)

080216 12:05:35 [Note] Event Scheduler: Killing the scheduler thread, thread id 12
080216 12:05:35 [Note] Event Scheduler: Waiting for the scheduler thread to reply
080216 12:05:35 [Note] Event Scheduler: Stopped
[16 Feb 2008 17:59] Konstantin Osipov
Santo,
please do not comment on a closed bug report, your comment is very unlikely to get attention.