summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2011-06-10 11:40:57 +0200
committerJon Olav Hauglid <jon.hauglid@oracle.com>2011-06-10 11:40:57 +0200
commitcd1dcf1adeb4245f17abd94e895c27a65becfac3 (patch)
tree46000c1b4d7112b0314328d628bd339c70efc8ff /mysql-test
parenta240df3336224832ce475bd2f37992a0d8c70af0 (diff)
downloadmariadb-git-cd1dcf1adeb4245f17abd94e895c27a65becfac3.tar.gz
Bug#12584161 - 43861: MAIN.QUERY_CACHE_28249 FAILS SPORADICALLY
This test case was failing on 5.5 and trunk for two reasons. 1) It waited for the "Waiting for table level lock" process state while this state was renamed "Waiting for table metadata lock" with the introduction of MDL in 5.5. 2) SET GLOBAL query_cache_size= 100000; gave a warning since query_cache_size is supposed to be multiples of 1024. This patch fixes these two issues and re-enables the test case.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/query_cache_28249.result6
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/query_cache_28249.test8
3 files changed, 7 insertions, 8 deletions
diff --git a/mysql-test/r/query_cache_28249.result b/mysql-test/r/query_cache_28249.result
index aed84911032..72d713e8e70 100644
--- a/mysql-test/r/query_cache_28249.result
+++ b/mysql-test/r/query_cache_28249.result
@@ -8,7 +8,7 @@ SET @query_cache_size= @@global.query_cache_size;
SET GLOBAL query_cache_type=1;
SET GLOBAL query_cache_limit=10000;
SET GLOBAL query_cache_min_res_unit=0;
-SET GLOBAL query_cache_size= 100000;
+SET GLOBAL query_cache_size= 102400;
FLUSH TABLES;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
@@ -23,10 +23,10 @@ SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
# Switch to connection user3
# Poll till the select of connection user1 is blocked by the write lock on t1.
SELECT user,command,state,info FROM information_schema.processlist
-WHERE state = 'Locked'
+WHERE state = 'Waiting for table metadata lock'
AND info = 'SELECT *, (SELECT COUNT(*) FROM t2) FROM t1';
user command state info
-root Query Locked SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+root Query Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
INSERT INTO t1 VALUES (4);
# Switch to connection user2
UNLOCK TABLES;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 872e6712070..ebcfa6b1845 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -15,5 +15,4 @@ sum_distinct-big : Bug#11764126 2010-11-15 mattiasj was not tested
alter_table-big : Bug#11748731 2010-11-15 mattiasj was not tested
create-big : Bug#11748731 2010-11-15 mattiasj was not tested
archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc
-main.query_cache_28249 : Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically
log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test
index 21768b27c2e..b1be7c57343 100644
--- a/mysql-test/t/query_cache_28249.test
+++ b/mysql-test/t/query_cache_28249.test
@@ -30,7 +30,7 @@ connection user1;
SET GLOBAL query_cache_type=1;
SET GLOBAL query_cache_limit=10000;
SET GLOBAL query_cache_min_res_unit=0;
-SET GLOBAL query_cache_size= 100000;
+SET GLOBAL query_cache_size= 102400;
FLUSH TABLES;
--disable_warnings
@@ -58,18 +58,18 @@ connection user3;
# Typical information_schema.processlist content after sufficient sleep time
# ID USER COMMAND TIME STATE INFO
# ....
-# 2 root Query 5 Waiting for table level lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
+# 2 root Query 5 Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
# ....
# XXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# The values marked with 'X' must be reached.
--echo # Poll till the select of connection user1 is blocked by the write lock on t1.
let $wait_condition= SELECT COUNT(*) = 1 FROM information_schema.processlist
-WHERE state = 'Waiting for table level lock'
+WHERE state = 'Waiting for table metadata lock'
AND info = '$select_for_qc';
--source include/wait_condition.inc
eval
SELECT user,command,state,info FROM information_schema.processlist
-WHERE state = 'Waiting for table level lock'
+WHERE state = 'Waiting for table metadata lock'
AND info = '$select_for_qc';
INSERT INTO t1 VALUES (4);