summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-07-18 16:34:50 +0300
committerunknown <bell@sanja.is.com.ua>2003-07-18 16:34:50 +0300
commitc64dda59434c026071c09515a68d3c70c15dd648 (patch)
treef2bcdd1acfa21ef0e9769fa781a39b8e48d1c79c /sql/sql_cache.cc
parentc8d7ca2b1ee4029454afea79def701af829e1db7 (diff)
downloadmariadb-git-c64dda59434c026071c09515a68d3c70c15dd648.tar.gz
allow to look up queries with leading comments
BitKeeper/etc/ignore: Added libmysqld/sp_cache.cc to the ignore list mysql-test/r/query_cache.result: test of query with leding comment mysql-test/t/query_cache.test: test of query with leding comment
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index c77d9c1f0b0..b97e9f02d3b 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -905,11 +905,16 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
/*
Test if the query is a SELECT
- (pre-space is removed in dispatch_command)
+ (pre-space is removed in dispatch_command).
+
+ First '/' looks like comment before command it is not
+ frequently appeared in real lihe, consequently we can
+ check all such queries, too.
*/
- if (my_toupper(system_charset_info, sql[0]) != 'S' ||
- my_toupper(system_charset_info, sql[1]) != 'E' ||
- my_toupper(system_charset_info,sql[2]) !='L')
+ if ((my_toupper(system_charset_info, sql[0]) != 'S' ||
+ my_toupper(system_charset_info, sql[1]) != 'E' ||
+ my_toupper(system_charset_info,sql[2]) !='L') &&
+ sql[0] != '/')
{
DBUG_PRINT("qcache", ("The statement is not a SELECT; Not cached"));
goto err;