summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect_mat.test
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2010-07-16 14:02:15 +0300
committerunknown <timour@askmonty.org>2010-07-16 14:02:15 +0300
commit2d78ffb8d54323d7908c3086f68093c049663318 (patch)
tree78edfa5c3e8b07f32b435971c53838a5d4833614 /mysql-test/t/subselect_mat.test
parent75bba30c5a0e65e3f5501492603370c7afc9444b (diff)
downloadmariadb-git-2d78ffb8d54323d7908c3086f68093c049663318.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..1c2869c628a 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 contents of the temp table of a materialized subquery is
+# cleaned up between PS re-executions.
+#
+
+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;