diff --git a/mysql-test/main/userstat.result b/mysql-test/main/userstat.result index 5315317e33a..d7c5a66bde9 100644 --- a/mysql-test/main/userstat.result +++ b/mysql-test/main/userstat.result @@ -247,6 +247,11 @@ select f() from information_schema.index_statistics; ERROR 21000: Subquery returns more than 1 row set global userstat= 0; drop function f; -# # End of 10.2 tests # +# MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds +# +select distinct busy_time>1e5, cpu_time>1e5 from information_schema.user_statistics; +busy_time>1e5 cpu_time>1e5 +0 0 +# End of 10.11 tests diff --git a/mysql-test/main/userstat.test b/mysql-test/main/userstat.test index 0c49acaa19e..d14228ed1b9 100644 --- a/mysql-test/main/userstat.test +++ b/mysql-test/main/userstat.test @@ -135,6 +135,11 @@ set global userstat= 0; drop function f; --enable_ps2_protocol ---echo # --echo # End of 10.2 tests + --echo # +--echo # MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds +--echo # +select distinct busy_time>1e5, cpu_time>1e5 from information_schema.user_statistics; + +--echo # End of 10.11 tests diff --git a/plugin/userstat/client_stats.cc b/plugin/userstat/client_stats.cc index 72c71785606..42d510b4a9b 100644 --- a/plugin/userstat/client_stats.cc +++ b/plugin/userstat/client_stats.cc @@ -45,8 +45,8 @@ static int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table) table->field[j++]->store((longlong)user_stats->total_connections,TRUE); table->field[j++]->store((longlong)user_stats->concurrent_connections, TRUE); table->field[j++]->store((longlong)user_stats->connected_time, TRUE); - table->field[j++]->store((double)user_stats->busy_time); - table->field[j++]->store((double)user_stats->cpu_time); + table->field[j++]->store((double)user_stats->busy_time/1e6); + table->field[j++]->store((double)user_stats->cpu_time/1e6); table->field[j++]->store((longlong)user_stats->bytes_received, TRUE); table->field[j++]->store((longlong)user_stats->bytes_sent, TRUE); table->field[j++]->store((longlong)user_stats->binlog_bytes_written, TRUE);