[Commits] dbfe5d566c3: MDEV-15805: Test failure on galera.query_cache
revision-id: dbfe5d566c34a18fd491758bc2785a17167553ce (mariadb-10.1.35-67-gdbfe5d566c3) parent(s): 3177d266273b4aa79973c49a519299f54ca097e7 author: Jan Lindström committer: Jan Lindström timestamp: 2018-09-20 06:51:40 +0300 message: MDEV-15805: Test failure on galera.query_cache Reset query cache after every test case and add wait after load infile. --- .../suite/galera/include/reset_query_cache.inc | 11 ++ mysql-test/suite/galera/r/query_cache.result | 25 +---- mysql-test/suite/galera/t/query_cache.test | 119 ++++++++++++++++++--- 3 files changed, 119 insertions(+), 36 deletions(-) diff --git a/mysql-test/suite/galera/include/reset_query_cache.inc b/mysql-test/suite/galera/include/reset_query_cache.inc new file mode 100644 index 00000000000..6e33b886f08 --- /dev/null +++ b/mysql-test/suite/galera/include/reset_query_cache.inc @@ -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 diff --git a/mysql-test/suite/galera/r/query_cache.result b/mysql-test/suite/galera/r/query_cache.result index 4b1b950e5c3..52cb990e1ab 100644 --- a/mysql-test/suite/galera/r/query_cache.result +++ b/mysql-test/suite/galera/r/query_cache.result @@ -402,22 +402,6 @@ Variable_name Value Qcache_queries_in_cache 1 set query_cache_type=on; # 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; a 1 @@ -1247,16 +1231,13 @@ Qcache_queries_in_cache 0 show status like "Qcache_hits"; Variable_name Value Qcache_hits 12 -select count(*) from t1; -count(*) -70 # On node-2 select count(*) from t1; count(*) 70 show status like "Qcache_queries_in_cache"; Variable_name Value -Qcache_queries_in_cache 1 +Qcache_queries_in_cache 2 show status like "Qcache_hits"; Variable_name Value Qcache_hits 11 @@ -1558,7 +1539,7 @@ Variable_name Value Qcache_queries_in_cache 0 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 38 +Qcache_inserts 39 show status like "Qcache_hits"; Variable_name Value Qcache_hits 11 @@ -1571,7 +1552,7 @@ Variable_name Value Qcache_queries_in_cache 1 show status like "Qcache_inserts"; Variable_name Value -Qcache_inserts 39 +Qcache_inserts 40 show status like "Qcache_hits"; Variable_name Value Qcache_hits 12 diff --git a/mysql-test/suite/galera/t/query_cache.test b/mysql-test/suite/galera/t/query_cache.test index 24ed8ecd077..a9374edc62a 100644 --- a/mysql-test/suite/galera/t/query_cache.test +++ b/mysql-test/suite/galera/t/query_cache.test @@ -113,6 +113,11 @@ show status like "Qcache_hits"; show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # MERGE TABLES with INSERT/UPDATE and DELETE # @@ -180,6 +185,11 @@ show status like "Qcache_hits"; drop table t1, t2, t3; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # SELECT SQL_CACHE ... # @@ -214,16 +224,7 @@ set query_cache_type=on; # # RESET QUERY CACHE # ---echo # On node-1 ---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"; +--source include/reset_query_cache.inc # # SELECT SQL_NO_CACHE @@ -240,6 +241,11 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # 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"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # 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"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Charset conversion (cp1251_koi8 always present) # 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"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Same tables in different dbs # @@ -376,6 +397,11 @@ show status like "Qcache_hits"; drop database mysqltest; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # FOUND_ROWS() # @@ -428,6 +454,11 @@ show status like "Qcache_queries_in_cache"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Test insert delayed (MYISAM) # @@ -526,6 +557,11 @@ drop table t2; set GLOBAL query_cache_min_res_unit=default; show global variables like "query_cache_min_res_unit"; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Case sensitive test # @@ -546,6 +582,11 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Test of query cache resizing # @@ -612,6 +653,11 @@ select * from t1; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Temporary tables (ignored by Galera) # @@ -645,6 +691,11 @@ show status like "Qcache_hits"; drop table t1, t2; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # System databse test (no need to perform it on node_2) # Note: Queries on system tables are not cached. @@ -697,6 +748,11 @@ show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; drop table t2; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # 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; show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; -select count(*) from t1; - -# Wait for "load data" to replicate. ---sleep 5 +--let $wait_condition = SELECT COUNT(*) = 70 FROM t1; +--source include/wait_condition.inc --echo # On node-2 --connection node_2 +--let $wait_condition = SELECT COUNT(*) = 70 FROM t1; +--source include/wait_condition.inc select count(*) from t1; show status like "Qcache_queries_in_cache"; show status like "Qcache_hits"; @@ -728,6 +784,11 @@ select count(*) from t1; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # 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.out.file +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Test of SQL_SELECT_LIMIT # @@ -777,6 +843,11 @@ SET SQL_SELECT_LIMIT=DEFAULT; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # WRITE LOCK & QC # @@ -844,6 +915,11 @@ select * from t1; drop table t1; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Test character set related variables: # character_set_result @@ -923,6 +999,11 @@ show status like "Qcache_queries_in_cache"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Comments before command # @@ -951,6 +1032,11 @@ show status like "Qcache_hits"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + # # Information schema & query cache test # @@ -988,6 +1074,11 @@ show status like 'qcache_queries_in_cache'; show status like "Qcache_hits"; drop table t1; +# +# RESET QUERY CACHE +# +--source include/reset_query_cache.inc + --echo # Restore original settings. --echo # On node-1 --connection node_1
participants (1)
-
jan