summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-31 08:24:12 +0300
committerunknown <bell@sanja.is.com.ua>2004-03-31 08:24:12 +0300
commit9c2e4b0360600840efa1ac396aa2f398ee07f4da (patch)
treec34e61f4dddc2cae03973f7a16b835d8d95f8dcd
parent4cd406a9294a15c598e19f3134d4033ed7c67a60 (diff)
parent963debbe778fb17dc6d99cc33020c63c5f7cb819 (diff)
downloadmariadb-git-9c2e4b0360600840efa1ac396aa2f398ee07f4da.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-qc-4.1
-rw-r--r--mysql-test/r/query_cache.result5
-rw-r--r--mysql-test/t/query_cache.test6
-rw-r--r--sql/sql_cache.cc9
3 files changed, 18 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 66422a5ed3a..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;
@@ -795,6 +797,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;
}
@@ -964,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)),