Commit feea10a4 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-5101 INFORMATION_SCHEMA.PROCESSLIST reports an incorrect value for Time for connecting threads

by convention query execution time should be 0 if its start_time is 0
(this was lost when fixing MDEV-4578)
parent 41fc2493
...@@ -2358,7 +2358,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) ...@@ -2358,7 +2358,8 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond)
command_name[tmp->command].length, cs); command_name[tmp->command].length, cs);
/* MYSQL_TIME */ /* MYSQL_TIME */
ulonglong start_utime= tmp->start_time * HRTIME_RESOLUTION + tmp->start_time_sec_part; ulonglong start_utime= tmp->start_time * HRTIME_RESOLUTION + tmp->start_time_sec_part;
ulonglong utime= start_utime < unow.val ? unow.val - start_utime : 0; ulonglong utime= start_utime && start_utime < unow.val
? unow.val - start_utime : 0;
table->field[5]->store(utime / HRTIME_RESOLUTION, TRUE); table->field[5]->store(utime / HRTIME_RESOLUTION, TRUE);
/* STATE */ /* STATE */
if ((val= thread_state_info(tmp))) if ((val= thread_state_info(tmp)))
......
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