summaryrefslogtreecommitdiff
path: root/sql/sql_cache.cc
diff options
context:
space:
mode:
authorVarun Gupta <varunraiko1803@gmail.com>2017-03-15 20:15:31 +0530
committerVarun Gupta <varunraiko1803@gmail.com>2017-03-15 20:15:31 +0530
commit6ac754163c417b907ce93ce2e0dd52d8d3cd35b8 (patch)
treebe2cc8b9364591245161558908cefa697b090064 /sql/sql_cache.cc
parent122d0701f7b933145d068d66fe72f6959b9afb14 (diff)
downloadmariadb-git-6ac754163c417b907ce93ce2e0dd52d8d3cd35b8.tar.gz
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
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r--sql/sql_cache.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 6b13dba876e..0bf83915ba8 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -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;