mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
bad5fdec18
The test runs a query in one thread, then in another queries the processlist and expects to find the first thread in the COM_SLEEP state. The problem is that the thread signals completion to the client before changing to COM_SLEEP state, so there is a window where the other thread can see the wrong state. A previous attempt to fix this was ineffective. It set a DEBUG_SYNC to handle proper waiting, but unfortunately that DEBUG_SYNC point ended up triggering already at the end of SET DEBUG_SYNC=xxx, so the wait was ineffective. Fix it properly now (hopefully) by ensuring that we wait for the DEBUG_SYNC point to trigger at the end of the SELECT SLEEP(), not just at the end of SET DEBUG_SYNC=xxx.
20 lines
730 B
Text
20 lines
730 B
Text
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
|
|
SELECT 1;
|
|
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
|
|
SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":TID:";
|
|
1
|
|
1
|
|
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
|
|
ID TIME TIME_MS
|
|
TID 0 0.000
|
|
SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2';
|
|
SET DEBUG_SYNC= 'now WAIT_FOR query_done';
|
|
SET DEBUG_SYNC= 'now SIGNAL nosignal';
|
|
select sleep(5);
|
|
sleep(5)
|
|
0
|
|
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
|
|
select command, time < 5 from information_schema.processlist where id != connection_id();
|
|
command time < 5
|
|
Sleep 1
|
|
set debug_sync='reset';
|