diff options
author | unknown <sanja@askmonty.org> | 2013-10-04 08:33:09 +0300 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2013-10-04 08:33:09 +0300 |
commit | 2f4db5348a43dea3ba21831955d0a029140d797c (patch) | |
tree | c99adb52d311673363c2b704acd7a4f19ce55d89 /mysql-test/r | |
parent | eae0a45f4e5ed4f1e382e53be74dd8082d4d797a (diff) | |
download | mariadb-git-2f4db5348a43dea3ba21831955d0a029140d797c.tar.gz |
MDEV-4981: Account for queries handled by query-cache in USER_STATISTICS (and in HOST_STATISTICS)
Added collection statistics for queries resolved via query cache.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/query_cache.result | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 2dd89d0e4bb..975b89b6e7a 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1932,6 +1932,85 @@ set local query_cache_type= on; select @@query_cache_size, @@global.query_cache_type, @@local.query_cache_type; @@query_cache_size @@global.query_cache_type @@local.query_cache_type 20971520 ON ON +# +# MDEV-4981: Account for queries handled by query-cache in +# USER_STATISTICS (and in HOST_STATISTICS) +# +SET GLOBAL userstat=1; +set GLOBAL query_cache_size=1355776; +FLUSH USER_STATISTICS; +FLUSH CLIENT_STATISTICS; +reset query cache; +flush status; +create table t1 (a int); +insert into t1 values (1); +select * from t1; +a +1 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS +where CLIENT="localhost"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +1 1 0 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS +where USER="root"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +2 2 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +select * from t1; +a +1 +select * from t1; +a +1 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS +where CLIENT="localhost"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +5 5 0 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS +where USER="root"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +6 6 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +FLUSH USER_STATISTICS; +FLUSH CLIENT_STATISTICS; +flush status; +create table t1 (a int); +select * from t1; +a +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS +where CLIENT="localhost"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +1 0 1 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS +where USER="root"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +2 1 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +select * from t1; +a +select * from t1; +a +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS +where CLIENT="localhost"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +5 2 3 +select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS +where USER="root"; +SELECT_COMMANDS ROWS_SENT EMPTY_QUERIES +6 3 3 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 2 +drop table t1; +SET GLOBAL userstat=default; +End of 5.5 tests restore defaults SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_size= default; |