summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-01-02 17:55:10 +0200
committerunknown <bell@sanja.is.com.ua>2002-01-02 17:55:10 +0200
commitb47495360cbd21fa80efc72c18e9892ffeebd1ed (patch)
treef1dae01091c7636f1a8737f2ba08b2fed29fa787 /sql/sql_cache.cc
parent19f4deb16b89ac6f771fdde1db5a2a106d8b33f7 (diff)
downloadmariadb-git-b47495360cbd21fa80efc72c18e9892ffeebd1ed.tar.gz
fixing query cache validator
BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc36
1 files changed, 35 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 523e835f472..70790a4efb5 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1385,7 +1385,6 @@ void Query_cache::free_cache(my_bool destruction)
hash_free(&tables);
if (!destruction)
STRUCT_UNLOCK(&structure_guard_mutex);
- DBUG_EXECUTE("check_querycache",check_integrity(););
}
DBUG_VOID_RETURN;
}
@@ -2809,6 +2808,13 @@ void Query_cache::wreck(uint line, const char *message)
void Query_cache::bins_dump()
{
uint i;
+
+ if ( !initialized )
+ {
+ DBUG_PRINT("qcache", ("Query Cache not initialized"));
+ return;
+ }
+
DBUG_PRINT("qcache", ("mem_bin_num=%u, mem_bin_steps=%u",
mem_bin_num, mem_bin_steps));
DBUG_PRINT("qcache", ("-------------------------"));
@@ -2844,6 +2850,13 @@ void Query_cache::bins_dump()
void Query_cache::cache_dump()
{
+
+ if ( !initialized )
+ {
+ DBUG_PRINT("qcache", ("Query Cache not initialized"));
+ return;
+ }
+
DBUG_PRINT("qcache", ("-------------------------------------"));
DBUG_PRINT("qcache", (" length used t nt"));
DBUG_PRINT("qcache", ("-------------------------------------"));
@@ -2864,6 +2877,13 @@ void Query_cache::cache_dump()
void Query_cache::queries_dump()
{
+
+ if ( !initialized )
+ {
+ DBUG_PRINT("qcache", ("Query Cache not initialized"));
+ return;
+ }
+
DBUG_PRINT("qcache", ("------------------"));
DBUG_PRINT("qcache", (" QUERIES"));
DBUG_PRINT("qcache", ("------------------"));
@@ -2920,6 +2940,13 @@ void Query_cache::queries_dump()
void Query_cache::tables_dump()
{
+
+ if ( !initialized )
+ {
+ DBUG_PRINT("qcache", ("Query Cache not initialized"));
+ return;
+ }
+
DBUG_PRINT("qcache", ("--------------------"));
DBUG_PRINT("qcache", ("TABLES"));
DBUG_PRINT("qcache", ("--------------------"));
@@ -2949,6 +2976,13 @@ my_bool Query_cache::check_integrity()
uint i;
STRUCT_LOCK(&structure_guard_mutex);
+ if ( !initialized )
+ {
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ DBUG_PRINT("qcache", ("Query Cache not initialized"));
+ return 0;
+ }
+
if (hash_check(&queries))
{
DBUG_PRINT("error", ("queries hash is damaged"));