MDEV-15805: Test failure on galera.query_cache
Reset query cache after every test case and add wait after load infile.
This commit is contained in:
parent
3177d26627
commit
428669fa83
11
mysql-test/suite/galera/include/reset_query_cache.inc
Normal file
11
mysql-test/suite/galera/include/reset_query_cache.inc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--disable_query_log
|
||||||
|
--disable_result_log
|
||||||
|
--connection node_1
|
||||||
|
flush query cache;
|
||||||
|
reset query cache;
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
flush query cache;
|
||||||
|
reset query cache;
|
||||||
|
--enable_result_log
|
||||||
|
--enable_query_log
|
@ -402,22 +402,6 @@ Variable_name Value
|
|||||||
Qcache_queries_in_cache 1
|
Qcache_queries_in_cache 1
|
||||||
set query_cache_type=on;
|
set query_cache_type=on;
|
||||||
# On node-1
|
# On node-1
|
||||||
reset query cache;
|
|
||||||
show status like "Qcache_queries_in_cache";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_queries_in_cache 0
|
|
||||||
show status like "Qcache_hits";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_hits 4
|
|
||||||
# On node-2
|
|
||||||
reset query cache;
|
|
||||||
show status like "Qcache_queries_in_cache";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_queries_in_cache 0
|
|
||||||
show status like "Qcache_hits";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_hits 3
|
|
||||||
# On node-1
|
|
||||||
select sql_no_cache * from t1;
|
select sql_no_cache * from t1;
|
||||||
a
|
a
|
||||||
1
|
1
|
||||||
@ -1247,16 +1231,13 @@ Qcache_queries_in_cache 0
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 12
|
Qcache_hits 12
|
||||||
select count(*) from t1;
|
|
||||||
count(*)
|
|
||||||
70
|
|
||||||
# On node-2
|
# On node-2
|
||||||
select count(*) from t1;
|
select count(*) from t1;
|
||||||
count(*)
|
count(*)
|
||||||
70
|
70
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 1
|
Qcache_queries_in_cache 2
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 11
|
Qcache_hits 11
|
||||||
@ -1533,9 +1514,6 @@ create table t1 (a int) engine=innodb;
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 0
|
Qcache_queries_in_cache 0
|
||||||
show status like "Qcache_inserts";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_inserts 46
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 12
|
Qcache_hits 12
|
||||||
@ -1546,9 +1524,6 @@ a
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 1
|
Qcache_queries_in_cache 1
|
||||||
show status like "Qcache_inserts";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_inserts 47
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 13
|
Qcache_hits 13
|
||||||
@ -1556,9 +1531,6 @@ Qcache_hits 13
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 0
|
Qcache_queries_in_cache 0
|
||||||
show status like "Qcache_inserts";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_inserts 38
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 11
|
Qcache_hits 11
|
||||||
@ -1569,9 +1541,6 @@ a
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_queries_in_cache 1
|
Qcache_queries_in_cache 1
|
||||||
show status like "Qcache_inserts";
|
|
||||||
Variable_name Value
|
|
||||||
Qcache_inserts 39
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_hits 12
|
Qcache_hits 12
|
||||||
|
@ -113,6 +113,11 @@ show status like "Qcache_hits";
|
|||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# MERGE TABLES with INSERT/UPDATE and DELETE
|
# MERGE TABLES with INSERT/UPDATE and DELETE
|
||||||
#
|
#
|
||||||
@ -180,6 +185,11 @@ show status like "Qcache_hits";
|
|||||||
|
|
||||||
drop table t1, t2, t3;
|
drop table t1, t2, t3;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# SELECT SQL_CACHE ...
|
# SELECT SQL_CACHE ...
|
||||||
#
|
#
|
||||||
@ -214,16 +224,7 @@ set query_cache_type=on;
|
|||||||
#
|
#
|
||||||
# RESET QUERY CACHE
|
# RESET QUERY CACHE
|
||||||
#
|
#
|
||||||
--echo # On node-1
|
--source include/reset_query_cache.inc
|
||||||
--connection node_1
|
|
||||||
reset query cache;
|
|
||||||
show status like "Qcache_queries_in_cache";
|
|
||||||
show status like "Qcache_hits";
|
|
||||||
--echo # On node-2
|
|
||||||
--connection node_2
|
|
||||||
reset query cache;
|
|
||||||
show status like "Qcache_queries_in_cache";
|
|
||||||
show status like "Qcache_hits";
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# SELECT SQL_NO_CACHE
|
# SELECT SQL_NO_CACHE
|
||||||
@ -240,6 +241,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check that queries that uses NOW(), LAST_INSERT_ID()... are not cached.
|
# Check that queries that uses NOW(), LAST_INSERT_ID()... are not cached.
|
||||||
#
|
#
|
||||||
@ -282,6 +288,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Non-cachable ODBC work around (and prepare cache for drop database)
|
# Non-cachable ODBC work around (and prepare cache for drop database)
|
||||||
#
|
#
|
||||||
@ -316,6 +327,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Charset conversion (cp1251_koi8 always present)
|
# Charset conversion (cp1251_koi8 always present)
|
||||||
# Note: Queries using different default character sets are cached separately.
|
# Note: Queries using different default character sets are cached separately.
|
||||||
@ -343,6 +359,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Same tables in different dbs
|
# Same tables in different dbs
|
||||||
#
|
#
|
||||||
@ -376,6 +397,11 @@ show status like "Qcache_hits";
|
|||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# FOUND_ROWS()
|
# FOUND_ROWS()
|
||||||
#
|
#
|
||||||
@ -428,6 +454,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test insert delayed (MYISAM)
|
# Test insert delayed (MYISAM)
|
||||||
#
|
#
|
||||||
@ -526,6 +557,11 @@ drop table t2;
|
|||||||
set GLOBAL query_cache_min_res_unit=default;
|
set GLOBAL query_cache_min_res_unit=default;
|
||||||
show global variables like "query_cache_min_res_unit";
|
show global variables like "query_cache_min_res_unit";
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Case sensitive test
|
# Case sensitive test
|
||||||
#
|
#
|
||||||
@ -546,6 +582,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test of query cache resizing
|
# Test of query cache resizing
|
||||||
#
|
#
|
||||||
@ -612,6 +653,11 @@ select * from t1;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Temporary tables (ignored by Galera)
|
# Temporary tables (ignored by Galera)
|
||||||
#
|
#
|
||||||
@ -645,6 +691,11 @@ show status like "Qcache_hits";
|
|||||||
|
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# System databse test (no need to perform it on node_2)
|
# System databse test (no need to perform it on node_2)
|
||||||
# Note: Queries on system tables are not cached.
|
# Note: Queries on system tables are not cached.
|
||||||
@ -697,6 +748,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t2;
|
drop table t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Load data invalidation test
|
# Load data invalidation test
|
||||||
#
|
#
|
||||||
@ -710,13 +766,13 @@ show status like "Qcache_hits";
|
|||||||
eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
|
eval load data infile '$MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
select count(*) from t1;
|
--let $wait_condition = SELECT COUNT(*) = 70 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
# Wait for "load data" to replicate.
|
|
||||||
--sleep 5
|
|
||||||
|
|
||||||
--echo # On node-2
|
--echo # On node-2
|
||||||
--connection node_2
|
--connection node_2
|
||||||
|
--let $wait_condition = SELECT COUNT(*) = 70 FROM t1;
|
||||||
|
--source include/wait_condition.inc
|
||||||
select count(*) from t1;
|
select count(*) from t1;
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
@ -728,6 +784,11 @@ select count(*) from t1;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# INTO OUTFILE/DUMPFILE test
|
# INTO OUTFILE/DUMPFILE test
|
||||||
#
|
#
|
||||||
@ -748,6 +809,11 @@ let $datadir=`select @@datadir`;
|
|||||||
--remove_file $datadir/test/query_cache.dump.file
|
--remove_file $datadir/test/query_cache.dump.file
|
||||||
--remove_file $datadir/test/query_cache.out.file
|
--remove_file $datadir/test/query_cache.out.file
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test of SQL_SELECT_LIMIT
|
# Test of SQL_SELECT_LIMIT
|
||||||
#
|
#
|
||||||
@ -777,6 +843,11 @@ SET SQL_SELECT_LIMIT=DEFAULT;
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# WRITE LOCK & QC
|
# WRITE LOCK & QC
|
||||||
#
|
#
|
||||||
@ -844,6 +915,11 @@ select * from t1;
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test character set related variables:
|
# Test character set related variables:
|
||||||
# character_set_result
|
# character_set_result
|
||||||
@ -923,6 +999,11 @@ show status like "Qcache_queries_in_cache";
|
|||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Comments before command
|
# Comments before command
|
||||||
#
|
#
|
||||||
@ -930,27 +1011,28 @@ drop table t1;
|
|||||||
--connection node_1
|
--connection node_1
|
||||||
create table t1 (a int) engine=innodb;
|
create table t1 (a int) engine=innodb;
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_inserts";
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
/**/ select * from t1;
|
/**/ select * from t1;
|
||||||
/**/ select * from t1;
|
/**/ select * from t1;
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_inserts";
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
|
|
||||||
--echo # On node-2
|
--echo # On node-2
|
||||||
--connection node_2
|
--connection node_2
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_inserts";
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
/**/ select * from t1;
|
/**/ select * from t1;
|
||||||
/**/ select * from t1;
|
/**/ select * from t1;
|
||||||
show status like "Qcache_queries_in_cache";
|
show status like "Qcache_queries_in_cache";
|
||||||
show status like "Qcache_inserts";
|
|
||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
#
|
#
|
||||||
# Information schema & query cache test
|
# Information schema & query cache test
|
||||||
#
|
#
|
||||||
@ -988,6 +1070,11 @@ show status like 'qcache_queries_in_cache';
|
|||||||
show status like "Qcache_hits";
|
show status like "Qcache_hits";
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# RESET QUERY CACHE
|
||||||
|
#
|
||||||
|
--source include/reset_query_cache.inc
|
||||||
|
|
||||||
--echo # Restore original settings.
|
--echo # Restore original settings.
|
||||||
--echo # On node-1
|
--echo # On node-1
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user