mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
@@ -1617,6 +1617,58 @@ select @@query_cache_size, @@global.query_cache_type, @@local.query_cache_type;
|
||||
set local query_cache_type= on;
|
||||
select @@query_cache_size, @@global.query_cache_type, @@local.query_cache_type;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-4981: Account for queries handled by query-cache in
|
||||
--echo # USER_STATISTICS (and in HOST_STATISTICS)
|
||||
--echo #
|
||||
|
||||
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;
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS
|
||||
where CLIENT="localhost";
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS
|
||||
where USER="root";
|
||||
show status like "Qcache_hits";
|
||||
select * from t1;
|
||||
select * from t1;
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS
|
||||
where CLIENT="localhost";
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS
|
||||
where USER="root";
|
||||
show status like "Qcache_hits";
|
||||
|
||||
drop table t1;
|
||||
FLUSH USER_STATISTICS;
|
||||
FLUSH CLIENT_STATISTICS;
|
||||
flush status;
|
||||
|
||||
create table t1 (a int);
|
||||
select * from t1;
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS
|
||||
where CLIENT="localhost";
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS
|
||||
where USER="root";
|
||||
show status like "Qcache_hits";
|
||||
select * from t1;
|
||||
select * from t1;
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.CLIENT_STATISTICS
|
||||
where CLIENT="localhost";
|
||||
select SELECT_COMMANDS,ROWS_SENT,EMPTY_QUERIES from INFORMATION_SCHEMA.USER_STATISTICS
|
||||
where USER="root";
|
||||
show status like "Qcache_hits";
|
||||
|
||||
drop table t1;
|
||||
SET GLOBAL userstat=default;
|
||||
|
||||
--echo End of 5.5 tests
|
||||
|
||||
--echo restore defaults
|
||||
SET GLOBAL query_cache_type= default;
|
||||
|
||||
Reference in New Issue
Block a user