mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
00649525ee
The test case tried to trigger a DEBUG_SYNC point at the end of a SELECT SLEEP(5) statement. It did this by using EXECUTE 2, intending to trigger first at the end of SET DEBUG_SYNC, and second at the end of the SELECT SLEEP(5). However, in --ps-protocol mode, this does not work, because the SELECT is executed in two steps (Prepare followed by Execute). Thus, the DEBUG_SYNC got triggered too early, during the Prepare stage rather than Execute, and the test case could race and information_schema.processlist see the thread in the wrong state. This patch fixes by changing the way the DEBUG_SYNC point is triggered. Now we add a DBUG injection inside the code for SLEEP(5). This ensures that the DEBUG_SYNC point is not activated until the SLEEP(5) is running, ensuring that the following wait for completion will be effective.
19 lines
659 B
Text
19 lines
659 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='reset';
|
|
SET debug_dbug="+d,sleep_inject_query_done_debug_sync";
|
|
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';
|