1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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
This commit is contained in:
unknown
2003-07-18 16:34:50 +03:00
parent c8d7ca2b1e
commit c64dda5943
4 changed files with 48 additions and 4 deletions

View File

@ -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;