From e85d6a915d242e8d39f021f4933c450323cec953 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Mar 2008 16:39:27 +0100 Subject: Bug#33756 - query cache with concurrent_insert=0 appears broken When concurrent inserts were disabled, statements after an INSERT were not put into the query cache. This happened because we do not save the current data file length at statement start when concurrent inserts are disabled. But we checked the always zero local length against the real file length anyway. Fixed by doing the check only if concurrent inserts are not diabled. mysql-test/r/query_cache.result: Bug#33756 - query cache with concurrent_insert=0 appears broken Added test result. mysql-test/t/query_cache.test: Bug#33756 - query cache with concurrent_insert=0 appears broken Added test. sql/ha_myisam.cc: Bug#33756 - query cache with concurrent_insert=0 appears broken Changed code so that file length check is done only when concurrent inserts are possible. --- mysql-test/r/query_cache.result | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mysql-test/r/query_cache.result') diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index 68f18d1b0b2..fa80a44c177 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -1654,3 +1654,30 @@ set GLOBAL query_cache_type=default; set GLOBAL query_cache_limit=default; set GLOBAL query_cache_min_res_unit=default; set GLOBAL query_cache_size=default; +use test; +FLUSH STATUS; +SET GLOBAL query_cache_size=10*1024*1024; +SET @save_concurrent_insert= @@concurrent_insert; +SET GLOBAL concurrent_insert= 0; +CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM; +INSERT INTO t1 (c1) VALUES (1), (2); +SHOW GLOBAL VARIABLES LIKE 'concurrent_insert'; +Variable_name Value +concurrent_insert 0 +SHOW STATUS LIKE 'Qcache_hits'; +Variable_name Value +Qcache_hits 0 +SELECT * FROM t1; +c1 +1 +2 +SELECT * FROM t1; +c1 +1 +2 +SHOW STATUS LIKE 'Qcache_hits'; +Variable_name Value +Qcache_hits 1 +DROP TABLE t1; +SET GLOBAL concurrent_insert= @save_concurrent_insert; +SET GLOBAL query_cache_size= default; -- cgit v1.2.1