mariadb/mysql-test/t/query_cache_disabled.test
Kristofer Pettersson ddcdacb297 Bug#38551 query cache can still consume [very little] cpu time even when it is off.
When the query cache is disabled, the server shouldn't attempt to take the 
query cache mutex.
                             
By using the command line option --query_cache_type=0, the user can disable
   
(backport from mysql-pe)


mysql-test/t/query_cache_disabled-master.opt:
  * added test case for bug38551
mysql-test/t/query_cache_disabled.test:
  * added test case for bug38551
sql/set_var.cc:
  * Added before-trigger to verify that query_cache_type wasn't turned off or on during
  runtime.
sql/set_var.h:
  * Changed order on how the enumeration is processed. By first projecting the
  character representation of the variable to a temporary integer we can have
  one function instead of two to check if the value is valid.
sql/share/errmsg-utf8.txt:
  * Added error message for query cache disabled state
sql/sql_cache.cc:
  * If the query cache is disabled at start up, shorten the execution path and avoid
  grabbing the query cache mutex each time the invalidate interface methods are called.
sql/sql_cache.h:
  * Added new methods to set the query cache into a disabled state.
2009-10-29 12:19:36 +01:00

15 lines
491 B
Text

-- source include/have_query_cache.inc
#
# Bug#38551 query cache can still consume [very little] cpu time even when it is off.
#
SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
--error ER_QUERY_CACHE_DISABLED
SET GLOBAL query_cache_type=ON;
--error ER_QUERY_CACHE_DISABLED
SET GLOBAL query_cache_type=DEMAND;
--error ER_QUERY_CACHE_DISABLED
SET GLOBAL query_cache_type=OFF;
SET GLOBAL query_cache_size=1024*1024;
SHOW GLOBAL VARIABLES LIKE 'query_cache_size';
SET GLOBAL query_cache_size=0;