1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

allow to look up queries with leading comments

This commit is contained in:
bell@sanja.is.com.ua
2003-07-18 16:34:50 +03:00
parent 035a4629ae
commit 19efafcc13
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;