Bug #9508 query_cache test fails with embedded server
Submitted: 31 Mar 2005 1:25 Modified: 15 Aug 2005 17:17
Reporter: Jim Winstead Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S3 (Non-critical)
Version:4.1 OS:
Assigned to: Alexey Botchkov CPU Architecture:Any

[31 Mar 2005 1:25] Jim Winstead
Description:
After eliminating the query_cache.result.es file, the query_cache test fails with the embedded server with the part in the 'How to repeat' section.

(Note that removing the query_cache.result.es file was a good thing, because it exposed another bug.)

How to repeat:
set GLOBAL query_cache_size=1355776;

# With join results...
create table t1 (a text not null);
create table t11 (a text not null);
create table t2 (a text not null);
create table t21 (a text not null);
create table t3 (a text not null);
insert into t1 values("1111111111111111111111111111111111111111111111111111");
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
# t11 and t21 must be over 4Kb (QUERY_CACHE_MIN_RESULT_DATA_SIZE)
insert into t11 select * from t1;
insert into t21 select * from t1;
insert into t1 select * from t2;
insert into t2 select * from t1;
insert into t1 select * from t2;
#results of t3 must  be > 0.5Mb
insert into t3 select * from t1;
insert into t3 select * from t2;
insert into t3 select * from t1;
disable_result_log;
select * from t11;
select * from t21;
enable_result_log;
show status like "Qcache_queries_in_cache";
show status like "Qcache_total_blocks";
show status like "Qcache_free_blocks";
disable_result_log;
insert into t11 values("");
select * from t3;
enable_result_log;
show status like "Qcache_queries_in_cache";
show status like "Qcache_total_blocks";
show status like "Qcache_free_blocks";
flush query cache;
show status like "Qcache_queries_in_cache";
show status like "Qcache_total_blocks";
show status like "Qcache_free_blocks";
drop table t1, t2, t3, t11, t21;

Suggested fix:
This may simply be due to the different nature of the query cache in the embedded server, in which case the test should be moved to a new test file and that test skipped for the embedded server. But I'm not sure yet what behavior the test is verifying.
[28 Jul 2005 13:33] 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/27679
[29 Jul 2005 12:06] 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/27715
[7 Aug 2005 1:57] Mike Hillyer
There is no three-part version number present for this fix. Reverting to Patch Approved. Please add an appropriate three-part version number and set back to Documenting status.
[8 Aug 2005 12:49] Alexey Botchkov
Pushed into 4.1.14
[15 Aug 2005 17:17] Mike Hillyer
Added to the 4.1.14 changelog:

<listitem><para>Added new query cache test for the embedded server to the test suite, there are now specific tests for the embedded and non-embedded servers. (Bug #9508)</para></listitem>