From 6f1decbf7736a42b8eb08ac6c05bd300cc9df1d3 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 29 Jun 2011 10:15:05 +0200 Subject: 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. --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_parse.cc') diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 36fdf376fa6..885db292699 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1308,7 +1308,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, length= my_snprintf(buff, buff_len - 1, "Uptime: %lu Threads: %d Questions: %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, (int) thread_count, (ulong) thd->query_id, current_global_status_var.long_query_count, -- cgit v1.2.1