Skip to content

Commit 60638a8

Browse files
committed
MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds
the bug was that MDEV-35720 missed two lines followup for 95975b9
1 parent acd071f commit 60638a8

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

mysql-test/main/userstat.result

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ select f() from information_schema.index_statistics;
247247
ERROR 21000: Subquery returns more than 1 row
248248
set global userstat= 0;
249249
drop function f;
250-
#
251250
# End of 10.2 tests
252251
#
252+
# MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds
253+
#
254+
select distinct busy_time>1e5, cpu_time>1e5 from information_schema.user_statistics;
255+
busy_time>1e5 cpu_time>1e5
256+
0 0
257+
# End of 10.11 tests

mysql-test/main/userstat.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ set global userstat= 0;
135135
drop function f;
136136
--enable_ps2_protocol
137137

138-
--echo #
139138
--echo # End of 10.2 tests
139+
140140
--echo #
141+
--echo # MDEV-36586 USER_STATISTICS.BUSY_TIME is in microseconds
142+
--echo #
143+
select distinct busy_time>1e5, cpu_time>1e5 from information_schema.user_statistics;
144+
145+
--echo # End of 10.11 tests

plugin/userstat/client_stats.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ static int send_user_stats(THD* thd, HASH *all_user_stats, TABLE *table)
4545
table->field[j++]->store((longlong)user_stats->total_connections,TRUE);
4646
table->field[j++]->store((longlong)user_stats->concurrent_connections, TRUE);
4747
table->field[j++]->store((longlong)user_stats->connected_time, TRUE);
48-
table->field[j++]->store((double)user_stats->busy_time);
49-
table->field[j++]->store((double)user_stats->cpu_time);
48+
table->field[j++]->store((double)user_stats->busy_time/1e6);
49+
table->field[j++]->store((double)user_stats->cpu_time/1e6);
5050
table->field[j++]->store((longlong)user_stats->bytes_received, TRUE);
5151
table->field[j++]->store((longlong)user_stats->bytes_sent, TRUE);
5252
table->field[j++]->store((longlong)user_stats->binlog_bytes_written, TRUE);

0 commit comments

Comments
 (0)