summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_mat.test
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2010-04-06 00:15:15 +0300
committerunknown <timour@askmonty.org>2010-04-06 00:15:15 +0300
commit3b05fc78e5dceebaa47c10d36ba667fb7be38fac (patch)
tree1ea66b0fcf606058c81d608a2cb51debb3d6b6cd /mysql-test/t/subselect_mat.test
parent3fc85580c9bc1e585de752697e3ae7ad02a64957 (diff)
downloadmariadb-git-3b05fc78e5dceebaa47c10d36ba667fb7be38fac.tar.gz
Fixed a problem where the temp table of a materialized subquery
was not cleaned up between PS re-executions. The reason was two-fold: - a merge with mysql-6.0 missed select_union::cleanup() that should have cleaned up the temp table, and - the subclass of select_union used by materialization didn't call the base class cleanup() method.
Diffstat (limited to 'mysql-test/t/subselect_mat.test')
-rw-r--r--mysql-test/t/subselect_mat.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_mat.test b/mysql-test/t/subselect_mat.test
index 54b1b5e15f9..dff9a7cf223 100644
--- a/mysql-test/t/subselect_mat.test
+++ b/mysql-test/t/subselect_mat.test
@@ -905,3 +905,19 @@ select * from t1 where t1.i in (select t2.i from t2 join t3 where t2.i + t3.i =
set session optimizer_switch=@save_optimizer_switch;
drop table t1, t2, t3;
+#
+# Test that the contentes of the temp table of a materialized subquery is
+# cleanup up between PS reexecutions.
+#
+
+create table t0 (a int);
+insert into t0 values (0),(1),(2);
+create table t1 (a int);
+insert into t1 values (0),(1),(2);
+explain select a, a in (select a from t1) from t0;
+select a, a in (select a from t1) from t0;
+prepare s from 'select a, a in (select a from t1) from t0';
+execute s;
+update t1 set a=123;
+execute s;
+drop table t0, t1;