diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result index af97aba6634..0182245c278 100644 --- a/mysql-test/r/processlist.result +++ b/mysql-test/r/processlist.result @@ -7,7 +7,9 @@ SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID 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'; +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 diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test index 12dd665b71b..9c555c0f9fb 100644 --- a/mysql-test/t/processlist.test +++ b/mysql-test/t/processlist.test @@ -28,7 +28,15 @@ connection default; # connection con1; -SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done'; +# Trigger a signal once the thread has gone from "Query" to "Sleep" command +# state. Note we need to execute this twice: Once at the end of SET DEBUG_SYNC, +# and once for the intended time, at the end of SELECT SLEEP(). +SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2'; +connection default; +# Wait for and clear the first signal set during SET DEBUG_SYNC. +SET DEBUG_SYNC= 'now WAIT_FOR query_done'; +SET DEBUG_SYNC= 'now SIGNAL nosignal'; +connection con1; select sleep(5); #run a query that will take some time connection default;