Bug #34804 After re-start of the scheduler disabled events are not dropped from disk
Submitted: 25 Feb 2008 12:51 Modified: 28 Aug 2012 2:11
Reporter: Andrey Hristov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any

[25 Feb 2008 12:51] Andrey Hristov
Description:
 If the scheduler was switched off and then on, then one or more events could be marked disabled because the wall clock shows time past their ENDS clause. In this case all the events which are with status DISABLED will be removed from the in-memory queue (bug#22738). However, some of them might be ON COMPLETION NOT PRESERVE. These won't be removed from mysql.event until the server is restarted, thus might hog mysql.event.

How to repeat:
use test;
set global event_scheduler=1;
create event abc on schedule every 10 second ends now() + interval 25 second do select 1;
select sleep(3);
set global event_scheduler=0;
select sleep(30);
set global event_scheduler=1;
select * from mysql.event where name="abc";
[25 Feb 2008 14:36] MySQL Verification Team
Thank you for the bug report. Verified as described.
[28 Aug 2012 2:11] Paul DuBois
Noted in 5.7.0 changelog.

An event was not dropped from the mysql.event table under these
circumstances: The event was created while the event scheduler was
enabled; the scheduler was disabled and re-enabled; the event
expiration time was reached.