1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-10766: Queries which start with WITH clause do not get inserted into query cache

Added conditions so that the WITH queries are also added to the query cache
This commit is contained in:
Varun Gupta
2017-03-15 20:15:31 +05:30
parent 122d0701f7
commit 6ac754163c
3 changed files with 53 additions and 1 deletions

View File

@ -1828,7 +1828,10 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
}
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'))
my_toupper(system_charset_info, sql[2]) != 'L') &&
(my_toupper(system_charset_info, sql[0]) != 'W' ||
my_toupper(system_charset_info, sql[1]) != 'I' ||
my_toupper(system_charset_info, sql[2]) != 'T'))
{
DBUG_PRINT("qcache", ("The statement is not a SELECT; Not cached"));
goto err;