Commit 6f1decbf authored by Marc Alff's avatar Marc Alff

Bug#12565712 - 61205: "QUERIES PER SECOND AVG" VALUE IN STATUS OUTPUT IS INCORRECT

Before this fix, a server executing 1009 queries in 1000 seconds would give a status of:
Queries per second avg: 1.9
The printf format used to print the decimal part, computed separately, is incorrect.

With this fix, the correct result is printed:
Queries per second avg: 1.009

Tested manually, no test case provided.
parent 8c988dc6
...@@ -1308,7 +1308,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1308,7 +1308,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
length= my_snprintf(buff, buff_len - 1, length= my_snprintf(buff, buff_len - 1,
"Uptime: %lu Threads: %d Questions: %lu " "Uptime: %lu Threads: %d Questions: %lu "
"Slow queries: %lu Opens: %lu Flush tables: %lu " "Slow queries: %lu Opens: %lu Flush tables: %lu "
"Open tables: %u Queries per second avg: %u.%u", "Open tables: %u Queries per second avg: %u.%03u",
uptime, uptime,
(int) thread_count, (ulong) thd->query_id, (int) thread_count, (ulong) thd->query_id,
current_global_status_var.long_query_count, current_global_status_var.long_query_count,
......
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