summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2003-01-17 15:36:08 +0200
committerbell@sanja.is.com.ua <>2003-01-17 15:36:08 +0200
commit1dde85db7c940b37112e6be284c7c6be4f6fead4 (patch)
tree1daa68f4d6777bca4ba2a507a8744f328f50342f /sql/sql_cache.cc
parent4306940bb4956093e3d23c8a800dc6438d730d10 (diff)
downloadmariadb-git-1dde85db7c940b37112e6be284c7c6be4f6fead4.tar.gz
using internal name conversion in query cache as it was suggested by Shurik
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 1cfbbf74da6..9e1d9c0b64c 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -357,12 +357,6 @@ 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=
{
@@ -2478,12 +2472,18 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
if (tables_used->table->db_type == DB_TYPE_MRG_ISAM ||
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'))
+ (tables_used->db_length == 5 &&
+#ifdef FN_NO_CASE_SENCE
+ // TODO: latin1 charset should be replaced with system charset
+ my_strncasecmp(my_charset_latin1,tables_used->db,"mysql",5) == 0
+#else
+ tables_used->db[0]=='m' &&
+ tables_used->db[1]=='y' &&
+ tables_used->db[2]=='s' &&
+ tables_used->db[3]=='q' &&
+ tables_used->db[4]=='l'
+#endif
+ ))
{
DBUG_PRINT("qcache",
("select not cacheable: used MRG_ISAM, temporary or system table(s)"));