Bug #20321 Events: Internal scheduler error 6
Submitted: 7 Jun 2006 16:58 Modified: 13 Oct 2010 14:47
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.12-beta-debug OS:Linux (SUSE 10.0)
Assigned to: Konstantin Osipov CPU Architecture:Any

[7 Jun 2006 16:58] Peter Gulutzan
Description:
I create an event, then I destroy it by delete from mysql.event, then I try to create it again.
I see the error message "Internal scheduler error 6". This is cryptic, and looks like something
that users are not expected to ever see. If the intent is to indicate that  "the proper way to
destroy an event is with DROP EVENT", then the message should say so.

How to repeat:
mysql> create event e on schedule every 1 second do set @a=5;
Query OK, 1 row affected (0.00 sec)

mysql> delete from mysql.event;
Query OK, 1 row affected (0.00 sec)

mysql> create event e on schedule every 1 second do set @a=5;
ERROR 1556 (HY000): Internal scheduler error 6
[7 Jun 2006 17:44] Andrey Hristov
So, let's turn it into documentation issue. Manipulating mysql.event in any other way except SELECT queries is unsupported.
Let's not forget that when having problem with storage engines we get also numbers. Like :
Storage Engine error 139.
[9 Jun 2006 11:14] Konstantin Osipov
Andrey, let's not use an example of cryptic behavior present in MySQL as an excuse for cryptic behavior of a new module. Instead, let's try to produce a more descriptive error messsage, as requested in the report. Please wait, however, with fixing this bug until milestone 3 - the whole Event_scheduler loop may change with the new LLD, as suggested by Alexander in his review.
[15 Sep 2006 15:18] Dmitry Lenev
Fixed in 5.1.12
[15 Sep 2006 16:08] Peter Gulutzan
Now, using the same statements after starting the scheduler:

set global event_scheduler = 1;
create event e on schedule every 1 second do set @a=5;
delete from mysql.event;
create event e on schedule every 1 second do set @a=5;

There is no error message for the client, but on the
server I see:

060915 10:04:00 [Note] SCHEDULER: Serious error during getting next event to execute. Stopping
060915 10:04:00 [Note] SCHEDULER: Stopped

Accordingly, I have re-opened the bug.
[27 Sep 2006 16:01] Andrey Hristov
The actual problem happens without the second CREATE EVENT. It's because the scheduler doesn't find the event on disk which is in the memory queue. This error can be handled without stopping the scheduler. However, the fix for this bug is dependent on the fix for bug#22740 Events: Decouple Event_queue from Event_db_repository
[7 Aug 2007 16:57] Konstantin Osipov
The behavior observed by Peter the second time can not be reproduced any more:
a failure to execute an individual event does not stop the event scheduler.
Still, the server does not handle this situation automatically -- it attempts to execute the event again and again. 
This is OK, since manual manipulation with mysql.event is not supported.
But more generally, what do we do if event execution repeatedly failed?
[13 Oct 2010 14:47] Konstantin Osipov
Closing the bug since the original problem is addressed, and the remnant does not seem to affect anyone.