summaryrefslogtreecommitdiff
path: root/sql/sql_cache.h
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-10-29 12:19:36 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-10-29 12:19:36 +0100
commit2d6a356abfc82a70c05167eb198669705c69daeb (patch)
treeee40d9b2a4d8b057cf54f1c758a85e0cbc092ab4 /sql/sql_cache.h
parent800ba382d9d724d9d0f465dd7f0689dacf8370af (diff)
downloadmariadb-git-2d6a356abfc82a70c05167eb198669705c69daeb.tar.gz
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)
Diffstat (limited to 'sql/sql_cache.h')
-rw-r--r--sql/sql_cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index 5a5f936c188..6b187ebd6c2 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -281,8 +281,11 @@ private:
enum Cache_lock_status { UNLOCKED, LOCKED_NO_WAIT, LOCKED };
Cache_lock_status m_cache_lock_status;
+ bool m_query_cache_is_disabled;
+
void free_query_internal(Query_cache_block *point);
void invalidate_table_internal(THD *thd, uchar *key, uint32 key_length);
+ void disable_query_cache(void) { m_query_cache_is_disabled= TRUE; }
protected:
/*
@@ -426,6 +429,8 @@ protected:
uint def_query_hash_size = QUERY_CACHE_DEF_QUERY_HASH_SIZE,
uint def_table_hash_size = QUERY_CACHE_DEF_TABLE_HASH_SIZE);
+ bool is_disabled(void) { return m_query_cache_is_disabled; }
+
/* initialize cache (mutex) */
void init();
/* resize query cache (return real query size, 0 if disabled) */