summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-09-15 15:16:13 +0300
committerunknown <bell@sanja.is.com.ua>2003-09-15 15:16:13 +0300
commitc35f246bd696366b272a51a2a86e3d17faabd3c3 (patch)
treecd69fbbadeb59606c13330386fb08e55d3a2489e /mysql-test
parentcdbc2fe43a0d9d19bdaec304d841fe45e3e91551 (diff)
downloadmariadb-git-c35f246bd696366b272a51a2a86e3d17faabd3c3.tar.gz
fixed server crash on moving query block with pointers to same table in it (BUG#988)
removed server options BitKeeper/deleted/.del-query_cache-master.opt~c4daeaa5e40881: Delete: mysql-test/t/query_cache-master.opt mysql-test/r/query_cache.result: test for BUG#988 mysql-test/t/query_cache.test: test for BUG#988 removed server options sql/sql_cache.cc: fixed moving query block with pointers to same table in it
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/query_cache.result43
-rw-r--r--mysql-test/t/query_cache-master.opt1
-rw-r--r--mysql-test/t/query_cache.test55
3 files changed, 96 insertions, 3 deletions
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 0b86c79afbf..83d2e439fbc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -1,8 +1,9 @@
+set GLOBAL query_cache_size=1355776;
flush query cache;
flush query cache;
reset query cache;
flush status;
-drop table if exists t1,t2,t3;
+drop table if exists t1,t2,t3,t4,t11,t21;
drop database if exists mysqltest;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
@@ -640,3 +641,43 @@ Variable_name Value
Qcache_queries_in_cache 2
SET OPTION SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
+flush query cache;
+reset query cache;
+flush status;
+set GLOBAL query_cache_size=1048576;
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+create table t2 (a text not null);
+create table t3 (a text not null);
+insert into t3 values("1111111111111111111111111111111111111111111111111111");
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+drop table t2;
+create table t2 (a int not null);
+insert into t2 values (1),(2),(3);
+create table t4 (a int not null);
+insert into t4 values (1),(2),(3);
+select * from t4;
+select * from t2;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+select * from t2;
+select * from t4;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+select * from t2;
+select * from t4;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+delete from t2 where a=1;
+flush query cache;
+select * from t3;
+delete from t4 where a=1;
+flush query cache;
+drop table t1,t2,t3,t4;
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/t/query_cache-master.opt b/mysql-test/t/query_cache-master.opt
deleted file mode 100644
index cfdce628e74..00000000000
--- a/mysql-test/t/query_cache-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---set-variable=query_cache_size=1355776
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index 9e1c22ac642..2ab5504f84b 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -3,6 +3,7 @@
#
# Tests with query cache
#
+set GLOBAL query_cache_size=1355776;
# Reset query cache variables.
@@ -10,7 +11,7 @@ flush query cache; # This crashed in some versions
flush query cache; # This crashed in some versions
reset query cache;
flush status;
-drop table if exists t1,t2,t3;
+drop table if exists t1,t2,t3,t4,t11,t21;
drop database if exists mysqltest;
#
@@ -450,3 +451,55 @@ select * from t1;
show status like "Qcache_queries_in_cache";
SET OPTION SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
+
+
+#
+# query cache crash on using same table twice in one query test
+#
+flush query cache;
+reset query cache;
+flush status;
+set GLOBAL query_cache_size=1048576;
+
+
+create table t1 (a int not null);
+insert into t1 values (1),(2),(3);
+create table t2 (a text not null);
+create table t3 (a text not null);
+insert into t3 values("1111111111111111111111111111111111111111111111111111");
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+insert into t2 select * from t3;
+insert into t3 select * from t2;
+drop table t2;
+create table t2 (a int not null);
+insert into t2 values (1),(2),(3);
+create table t4 (a int not null);
+insert into t4 values (1),(2),(3);
+
+disable_result_log;
+select * from t4;
+select * from t2;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+select * from t2;
+select * from t4;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+select * from t2;
+select * from t4;
+select * from t1 as tt, t1 as ttt where tt.a=1 and ttt.a=2;
+
+delete from t2 where a=1;
+flush query cache;
+select * from t3;
+enable_result_log;
+delete from t4 where a=1;
+flush query cache;
+
+drop table t1,t2,t3,t4;
+set GLOBAL query_cache_size=0;