Bug #11522 QC: queries with subqueries in the FROM clause are not cached by query cache
Submitted: 23 Jun 2005 7:01 Modified: 25 Jul 2005 20:21
Reporter: Oleksandr Byelkin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1 OS:Any (all)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[23 Jun 2005 7:01] Oleksandr Byelkin
Description:
queries with subqueries in the FROM clause are not cached by query cache

How to repeat:
mysql-test script:

set GLOBAL query_cache_size=1355776;
create table t1 (a int);
insert into t1 values (1);
reset query cache;
flush status;
select * from (select * from t1) a;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from (select * from t1) a;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
drop table t1;

Suggested fix:
allow queries with temporary tables made for subquery in the FROM clause for caching
[23 Jun 2005 14:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/26373
[4 Jul 2005 6:42] Oleksandr Byelkin
pushed to 4.1.13
[25 Jul 2005 20:21] Mike Hillyer
Documented in 4.1.13 changelog:

<listitem><para>Queries with subqueries in the <literal>FROM</literal> clause were not being added to the query cache. (Bug #11522)</para></listitem>