summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2002-10-08 00:26:15 +0300
committerunknown <bell@sanja.is.com.ua>2002-10-08 00:26:15 +0300
commitda4d15312446b151e7225434734246f1e5538118 (patch)
tree1f656592d377f96fbe4e104ca29476b1bc3f5a71 /sql/sql_cache.cc
parenta30eaeb08361be650e0d7f6dc544fb71f7b73680 (diff)
downloadmariadb-git-da4d15312446b151e7225434734246f1e5538118.tar.gz
fixed query cache with system database
FN_NO_CASE_SENCE used instead of __WIN__ in table name handling of quary cache mysql-test/r/query_cache.result: query cache with system database test mysql-test/t/query_cache.test: query cache with system database test sql/sql_cache.cc: fixed query cache with system database FN_NO_CASE_SENCE used instead of __WIN__
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 149b10ecc99..0b9caf4e6c3 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -342,6 +342,12 @@ TODO list:
#define DUMP(C)
#endif
+#ifdef FN_NO_CASE_SENCE
+#define DB_NAME_PREPROCESS(C) tolower(C)
+#else
+#define DB_NAME_PREPROCESS(C) (C)
+#endif
+
const char *query_cache_type_names[]= { "OFF", "ON", "DEMAND",NullS };
TYPELIB query_cache_type_typelib=
{
@@ -1378,11 +1384,11 @@ ulong Query_cache::init_cache()
VOID(hash_init(&queries,def_query_hash_size, 0, 0,
query_cache_query_get_key, 0, 0));
-#ifndef __WIN__
+#ifndef FN_NO_CASE_SENCE
VOID(hash_init(&tables,def_table_hash_size, 0, 0,
query_cache_table_get_key, 0, 0));
#else
- // windows case insensitive file names work around
+ // windows, OS/2 or other case insensitive file names work around
VOID(hash_init(&tables,def_table_hash_size, 0, 0,
query_cache_table_get_key, 0,
(lower_case_table_names?0:HASH_CASE_INSENSITIVE)));
@@ -2432,7 +2438,7 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
lex->select->options,
(int) thd->variables.query_cache_type));
- for (; tables_used; tables_used=tables_used->next)
+ for (; tables_used; tables_used= tables_used->next)
{
tables++;
DBUG_PRINT("qcache", ("table %s, db %s, type %u",
@@ -2442,10 +2448,16 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
tables_used->table->file->has_transactions());
if (tables_used->table->db_type == DB_TYPE_MRG_ISAM ||
- tables_used->table->tmp_table != NO_TMP_TABLE)
+ tables_used->table->tmp_table != NO_TMP_TABLE ||
+ (tables_used->db_length == 5 &&
+ DB_NAME_PREPROCESS(tables_used->db[0])=='m' &&
+ DB_NAME_PREPROCESS(tables_used->db[1])=='y' &&
+ DB_NAME_PREPROCESS(tables_used->db[2])=='s' &&
+ DB_NAME_PREPROCESS(tables_used->db[3])=='q' &&
+ DB_NAME_PREPROCESS(tables_used->db[4])=='l'))
{
DBUG_PRINT("qcache",
- ("select not cacheable: used MRG_ISAM or temporary table(s)"));
+ ("select not cacheable: used MRG_ISAM, temporary or system table(s)"));
DBUG_RETURN(0);
}
if (tables_used->table->db_type == DB_TYPE_MRG_MYISAM)