|
The issue appears to be a simple race condition, on rare occasion execution of the event (the one that inserts 10 into the table takes too long, it outlives disabling event_scheduler, cleaning up the table and re-enabling event_scheduler again. An injected delay allows to reproduce it reliably:
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
|
index e02b618..7e0df5c 100644
|
--- a/sql/event_scheduler.cc
|
+++ b/sql/event_scheduler.cc
|
@@ -181,6 +181,8 @@ pre_init_event_thread(THD* thd)
|
THD *orig_thd= current_thd;
|
DBUG_ENTER("pre_init_event_thread");
|
|
+ my_sleep(1000000);
|
+
|
set_current_thd(thd);
|
thd->client_capabilities= 0;
|
thd->security_ctx->master_access= 0;
|
|