MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds

the bug was that MDEV-35720 missed two lines

followup for 95975b921e9
This commit is contained in:
Sergei Golubchik 2025-04-13 12:11:34 +02:00
parent acd071f599
commit 60638a84e8
3 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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);