From 54d5f4ae8f9d49ab4f023be652346d169b4f34d4 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Tue, 30 Mar 2004 18:47:04 +0300 Subject: query cache statistic fixed --- sql/sql_cache.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 66422a5ed3a..4e111df9263 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -795,6 +795,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) if (ask_handler_allowance(thd, tables_used)) { + refused++; STRUCT_UNLOCK(&structure_guard_mutex); DBUG_VOID_RETURN; } -- cgit v1.2.1 From e3a619f0059c6f3a90a21b0e8219b049e5056ee3 Mon Sep 17 00:00:00 2001 From: "bell@sanja.is.com.ua" <> Date: Tue, 30 Mar 2004 23:38:56 +0300 Subject: null processing for character_set_results (BUG#3296) --- mysql-test/r/query_cache.result | 5 +++++ mysql-test/t/query_cache.test | 6 ++++++ sql/sql_cache.cc | 8 ++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index bbba7026b14..8d03a7bbcf0 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -846,4 +846,9 @@ SELECT * FROM test.t1; a USE test; DROP TABLE t1; +set character_set_results=null; +select @@character_set_results; +@@character_set_results +NULL +set character_set_results=default; SET GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 31aa69e32ec..b3111b614c6 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -620,5 +620,11 @@ SELECT * FROM test.t1; USE test; DROP TABLE t1; +# +# charset with NULL +# +set character_set_results=null; +select @@character_set_results; +set character_set_results=default; SET GLOBAL query_cache_size=0; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 4e111df9263..39061a6501b 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -780,7 +780,9 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= - thd->variables.character_set_results->number; + (thd->variables.character_set_results ? + thd->variables.character_set_results->number : + UINT_MAX); flags.collation_connection_num= thd->variables.collation_connection->number; flags.limit= thd->variables.select_limit; @@ -965,7 +967,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= - thd->variables.character_set_results->number; + (thd->variables.character_set_results ? + thd->variables.character_set_results->number : + UINT_MAX); flags.collation_connection_num= thd->variables.collation_connection->number; flags.limit= thd->variables.select_limit; memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)), -- cgit v1.2.1