From 6ac754163c417b907ce93ce2e0dd52d8d3cd35b8 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Wed, 15 Mar 2017 20:15:31 +0530 Subject: 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 --- mysql-test/r/query_cache.result | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'mysql-test/r/query_cache.result') diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index d34c96cd568..276f7c470f1 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -2136,6 +2136,38 @@ Qcache_hits 1 use test; drop database `foo.bar`; End of 10.0 tests +# +# MDEV-10766 Queries which start with WITH clause do not get +# inserted into query cache +# +flush status; +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 0 +create table t1 (i int); +with cte as (select * from t1) select * from cte; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +with cte as (select * from t1) select * from cte; +i +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 0 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 0 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +drop table t1; restore defaults SET GLOBAL query_cache_type= default; SET GLOBAL query_cache_size= default; -- cgit v1.2.1