mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge moonbone.local:/work/15028-bug-5.0-mysql
into moonbone.local:/work/15028-bug-5.1-new-mysql
This commit is contained in:
@ -977,21 +977,32 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
Test if the query is a SELECT
|
||||
(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') &&
|
||||
sql[0] != '/')
|
||||
{
|
||||
DBUG_PRINT("qcache", ("The statement is not a SELECT; Not cached"));
|
||||
goto err;
|
||||
uint i= 0;
|
||||
/*
|
||||
Skip '(' characters in queries like following:
|
||||
(select a from t1) union (select a from t1);
|
||||
*/
|
||||
while (sql[i]=='(')
|
||||
i++;
|
||||
|
||||
|
||||
/*
|
||||
Test if the query is a SELECT
|
||||
(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[i]) != 'S' ||
|
||||
my_toupper(system_charset_info, sql[i + 1]) != 'E' ||
|
||||
my_toupper(system_charset_info, sql[i + 2]) != 'L') &&
|
||||
sql[0] != '/')
|
||||
{
|
||||
DBUG_PRINT("qcache", ("The statement is not a SELECT; Not cached"));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
STRUCT_LOCK(&structure_guard_mutex);
|
||||
|
Reference in New Issue
Block a user