2013-06-13 20:19:32 +02:00
|
|
|
#
|
|
|
|
# MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
|
|
|
|
#
|
|
|
|
|
|
|
|
source include/have_debug_sync.inc;
|
|
|
|
|
2014-10-22 13:51:33 +02:00
|
|
|
let $tid= `SELECT CONNECTION_ID()`;
|
2013-06-13 20:19:32 +02:00
|
|
|
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
|
|
|
|
send SELECT 1;
|
|
|
|
|
|
|
|
connect (con1,localhost,root,,);
|
|
|
|
|
|
|
|
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
|
2014-10-22 13:51:33 +02:00
|
|
|
--replace_result $tid TID
|
|
|
|
send_eval SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":$tid:";
|
2013-06-13 20:19:32 +02:00
|
|
|
|
|
|
|
connection default;
|
|
|
|
reap;
|
|
|
|
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
|
|
|
|
|
|
|
|
connection con1;
|
2014-10-22 13:51:33 +02:00
|
|
|
--replace_result $tid TID
|
2013-06-13 20:19:32 +02:00
|
|
|
reap;
|
2013-07-01 12:02:44 +02:00
|
|
|
connection default;
|
|
|
|
|
|
|
|
#
|
|
|
|
# MDEV-4683 query start_time not reset when going to sleep
|
|
|
|
#
|
|
|
|
|
|
|
|
connection con1;
|
2014-10-31 12:48:17 +01:00
|
|
|
# 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;
|
2013-07-01 12:02:44 +02:00
|
|
|
select sleep(5); #run a query that will take some time
|
|
|
|
connection default;
|
|
|
|
|
2014-10-22 13:51:33 +02:00
|
|
|
# Need to ensure that the previous query has really completed. Otherwise,
|
|
|
|
# the select could see the previous query still in "Query" stage in the
|
|
|
|
# processlist.
|
|
|
|
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
|
|
|
|
|
2013-07-01 12:02:44 +02:00
|
|
|
# verify that the time in COM_SLEEP doesn't include the query run time
|
|
|
|
select command, time < 5 from information_schema.processlist where id != connection_id();
|
|
|
|
|
2013-06-13 20:19:32 +02:00
|
|
|
disconnect con1;
|
2014-01-27 12:10:53 +01:00
|
|
|
set debug_sync='reset';
|