Bug #15093 query cache does not cache queries in brakets ()
Submitted: 21 Nov 2005 9:43 Modified: 21 Nov 2005 17:28
Reporter: Gunnar von Boehn Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.15 OS:Linux (linux debian)
Assigned to: CPU Architecture:Any

[21 Nov 2005 9:43] Gunnar von Boehn
Description:
I noticed that the query cache did not cache my select using unions.
Looking closer at it, the query cache does not cache queries in brakets () at all.

How to repeat:
use test;
create table test(name char(5));
insert into test set name='mysql';

SHOW STATUS LIKE 'Qcache%';

select * from test;
select * from test;
select * from test;

SHOW STATUS LIKE 'Qcache%';

#You'll see that the above selects are cached

(select * from test);
(select * from test);
(select * from test);

SHOW STATUS LIKE 'Qcache%';

#You'll see that the above queries in () are not cached

Suggested fix:
Can you please fix this?
I have that fixing the braket caching will make these queries cacheable too?

(SELECT a AS b FROM t) UNION (SELECT ...) ORDER BY b;

Cheers
Gunnar
[21 Nov 2005 17:28] Valeriy Kravchuk
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.

Additional info:

It is a duplicate of http://bugs.mysql.com/bug.php?id=14652, from my point of view. Wait for the fix, please.