Commit 03c71ff2 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4683 query start_time not reset when going to sleep

parent a924e900
...@@ -7,3 +7,9 @@ SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL; ...@@ -7,3 +7,9 @@ SELECT INFO,TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO IS NULL;
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
INFO TIME TIME_MS INFO TIME TIME_MS
NULL 0 0.000 NULL 0 0.000
select sleep(5);
sleep(5)
0
select command, time < 5 from information_schema.processlist where id != connection_id();
command time < 5
Sleep 1
...@@ -18,5 +18,18 @@ SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed'; ...@@ -18,5 +18,18 @@ SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
connection con1; connection con1;
reap; reap;
connection default;
#
# MDEV-4683 query start_time not reset when going to sleep
#
connection con1;
select sleep(5); #run a query that will take some time
connection default;
# 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();
disconnect con1; disconnect con1;
...@@ -1461,6 +1461,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1461,6 +1461,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd_proc_info(thd, "cleaning up"); thd_proc_info(thd, "cleaning up");
thd->reset_query(); thd->reset_query();
thd->command=COM_SLEEP; thd->command=COM_SLEEP;
thd->set_time();
dec_thread_running(); dec_thread_running();
thd_proc_info(thd, 0); thd_proc_info(thd, 0);
thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment