Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL)
-
None
Description
http://buildbot.askmonty.org/buildbot/builders/winx64-packages/builds/4253/steps/test/logs/stdio
main.create_drop_event w2 [ fail ]
|
Test ended at 2017-08-03 07:22:16
|
|
CURRENT_TEST: main.create_drop_event
|
--- D:/winx64-packages/build/src/mysql-test/r/create_drop_event.result 2017-08-03 05:45:17.000000000 +0000
|
+++ D:\winx64-packages\build\src\mysql-test\r\create_drop_event.reject 2017-08-03 07:22:15.316006100 +0000
|
@@ -31,7 +31,7 @@
|
SET GLOBAL event_scheduler=on;
|
SELECT DISTINCT a FROM t1;
|
a
|
-13
|
+10
|
SET GLOBAL event_scheduler=off;
|
DELETE FROM t1;
|
DROP EVENT IF EXISTS ev1;
|
|
mysqltest: Result content mismatch
|
All recorded failures happened on Windows, first time in January 2017 on bb-10.2-serg. There have been 6 occurrences since then on 10.2-based trees, and one occurrence on Aug 8th on 10.1 tree.
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;