summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps.test
diff options
context:
space:
mode:
authorunknown <andrey@lmy004.>2005-09-08 21:30:05 +0200
committerunknown <andrey@lmy004.>2005-09-08 21:30:05 +0200
commitf25716382447a3006408f9c1fa508f05dfce256b (patch)
treecd57feea4289bdb595fdb50a324b5904d8ee07eb /mysql-test/t/ps.test
parent996d4c455ec25596f256ecbf3e7c875c9397fd04 (diff)
downloadmariadb-git-f25716382447a3006408f9c1fa508f05dfce256b.tar.gz
fix for bug #12651 (item of a prepared query allocated on non-permanent
are thus dangling later) mysql-test/r/ps.result: test for bug #12651 (data allocated on thd's arena but not on permanent arena) mysql-test/t/ps.test: test for bug #12651 (data allocated on thd's arena but not on permanent arena) sql/sql_base.cc: if there is tree transformation then backup the current arena and use permanent one (for PS) otherwise the data will be deallocated after the prepare process is finished. this bug was introduced with the recent natural join patch
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r--mysql-test/t/ps.test15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 94596fbbc0e..94ee2b1ca39 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -809,6 +809,21 @@ select ??;
select ? from t1;
--enable_ps_protocol
drop table t1;
+
+#
+# Bug#12651
+# (Crash on a PS including a subquery which is a select from a simple view)
+#
+CREATE TABLE b12651_T1(a int) ENGINE=MYISAM;
+CREATE TABLE b12651_T2(b int) ENGINE=MYISAM;
+CREATE VIEW b12651_V1 as SELECT b FROM b12651_T2;
+
+PREPARE b12651 FROM 'SELECT 1 FROM b12651_T1 WHERE a IN (SELECT b FROM b12651_V1)';
+EXECUTE b12651;
+
+DROP VIEW b12651_V1;
+DROP TABLE b12651_T1, b12651_T2;
+
#
# Bug#9359 "Prepared statements take snapshot of system vars at PREPARE
# time"