Commit 4859c13c authored by Sneha MOdi's avatar Sneha MOdi

BUG#11754170: TEST CASE FOR BUG#28211 IS DISABLED IN QUERY_CACHE.TEST as RENAME DATABASE

and query_cache don't play along nicely.

An alternative for RENAME DATABSE using RENAME TABLE has been used to implement this.
parent 8c344c68
......@@ -1583,6 +1583,58 @@ show status like 'Qcache_free_blocks';
Variable_name Value
Qcache_free_blocks 0
Restore default values.
drop database if exists db1;
drop database if exists db2;
set GLOBAL query_cache_size=15*1024*1024;
create database db1;
use db1;
create table t1(c1 int)engine=myisam;
insert into t1(c1) values (1);
select * from db1.t1 f;
c1
1
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
create database db2;
rename table db1.t1 to db2.t2;
drop database db1;
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
drop database db2;
set global query_cache_size=default;
drop database if exists db1;
drop database if exists db3;
set GLOBAL query_cache_size=15*1024*1024;
create database db1;
create database db3;
use db1;
create table t1(c1 int) engine=myisam;
use db3;
create table t1(c1 int) engine=myisam;
use db1;
insert into t1(c1) values (1);
use mysql;
select * from db1.t1;
c1
1
select c1+1 from db1.t1;
c1+1
2
select * from db3.t1;
c1
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 3
create database db2;
rename table db1.t1 to db2.t2;
drop database db1;
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
drop database db2;
drop database db3;
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
......@@ -1609,7 +1661,7 @@ c1
2
SHOW STATUS LIKE 'Qcache_hits';
Variable_name Value
Qcache_hits 1
Qcache_hits 0
DROP TABLE t1;
SET GLOBAL concurrent_insert= @save_concurrent_insert;
SET GLOBAL query_cache_size= default;
......@@ -1639,7 +1691,7 @@ a
COMMIT;
SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 2
Qcache_queries_in_cache 0
SHOW STATUS LIKE "Qcache_hits";
Variable_name Value
Qcache_hits 0
......@@ -1661,7 +1713,7 @@ a
COMMIT;
SHOW STATUS LIKE "Qcache_hits";
Variable_name Value
Qcache_hits 2
Qcache_hits 0
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
End of 5.0 tests
......
......@@ -1193,47 +1193,48 @@ set global query_cache_type=0;
show status like 'Qcache_free_blocks';
--echo Restore default values.
# Bug#28211 RENAME DATABASE and query cache don't play nicely together
#
# TODO: enable these tests when RENAME DATABASE is implemented.
# --disable_warnings
# drop database if exists db1;
# drop database if exists db2;
# --enable_warnings
# set GLOBAL query_cache_size=15*1024*1024;
# create database db1;
# use db1;
# create table t1(c1 int)engine=myisam;
# insert into t1(c1) values (1);
# select * from db1.t1 f;
# show status like 'Qcache_queries_in_cache';
# rename schema db1 to db2;
# show status like 'Qcache_queries_in_cache';
# drop database db2;
# set global query_cache_size=default;
#
# --disable_warnings
# drop database if exists db1;
# drop database if exists db3;
# --enable_warnings
# set GLOBAL query_cache_size=15*1024*1024;
# create database db1;
# create database db3;
# use db1;
# create table t1(c1 int) engine=myisam;
# use db3;
# create table t1(c1 int) engine=myisam;
# use db1;
# insert into t1(c1) values (1);
# use mysql;
# select * from db1.t1;
# select c1+1 from db1.t1;
# select * from db3.t1;
# show status like 'Qcache_queries_in_cache';
# rename schema db1 to db2;
# show status like 'Qcache_queries_in_cache';
# drop database db2;
# drop database db3;
--disable_warnings
drop database if exists db1;
drop database if exists db2;
--enable_warnings
set GLOBAL query_cache_size=15*1024*1024;
create database db1;
use db1;
create table t1(c1 int)engine=myisam;
insert into t1(c1) values (1);
select * from db1.t1 f;
show status like 'Qcache_queries_in_cache';
create database db2;
rename table db1.t1 to db2.t2;
drop database db1;
show status like 'Qcache_queries_in_cache';
drop database db2;
set global query_cache_size=default;
--disable_warnings
drop database if exists db1;
drop database if exists db3;
--enable_warnings
set GLOBAL query_cache_size=15*1024*1024;
create database db1;
create database db3;
use db1;
create table t1(c1 int) engine=myisam;
use db3;
create table t1(c1 int) engine=myisam;
use db1;
insert into t1(c1) values (1);
use mysql;
select * from db1.t1;
select c1+1 from db1.t1;
select * from db3.t1;
show status like 'Qcache_queries_in_cache';
create database db2;
rename table db1.t1 to db2.t2;
drop database db1;
show status like 'Qcache_queries_in_cache';
drop database db2;
drop database db3;
set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment