summaryrefslogtreecommitdiff
path: root/mysql-test/t/explain.test
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-03-24 11:27:11 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-03-24 11:27:11 +0100
commite57beba62dadd21c698a58cc805d0d3e2bd09451 (patch)
tree0995f2f971509550f444815e4701b16dc5617be2 /mysql-test/t/explain.test
parent9d32caa13d47a23fb6bbb6eefd8c76b7eac9d8ad (diff)
downloadmariadb-git-e57beba62dadd21c698a58cc805d0d3e2bd09451.tar.gz
Bug#11829785 EXPLAIN EXTENDED CRASH WITH RIGHT OUTER JOIN, SUBQUERIES
This is a backport of Bug #46860 Crash/segfault using EXPLAIN EXTENDED on query using UNION in subquery. mysql-test/r/explain.result: Remove the extended Note, since explain returns error. New test case. mysql-test/r/func_gconcat.result: Remove the extended Note, since explain returns error. mysql-test/r/subselect3.result: Remove the extended Note, since explain returns error. mysql-test/t/explain.test: New test case. sql/sql_parse.cc: Skip the extended description if we have an error.
Diffstat (limited to 'mysql-test/t/explain.test')
-rw-r--r--mysql-test/t/explain.test23
1 files changed, 22 insertions, 1 deletions
diff --git a/mysql-test/t/explain.test b/mysql-test/t/explain.test
index 931948b1b65..8376fdf1ad1 100644
--- a/mysql-test/t/explain.test
+++ b/mysql-test/t/explain.test
@@ -1,5 +1,5 @@
#
-# Test of different EXPLAIN's
+# Test of different EXPLAINs
--disable_warnings
drop table if exists t1;
@@ -275,3 +275,24 @@ DEALLOCATE PREPARE stmt;
DROP TABLE t1;
--echo End of 5.1 tests.
+
+--echo #
+--echo # Bug#11829785 EXPLAIN EXTENDED CRASH WITH RIGHT OUTER JOIN, SUBQUERIES
+--echo #
+
+CREATE TABLE t1(a INT);
+
+INSERT INTO t1 VALUES (0), (0);
+
+PREPARE s FROM
+'EXPLAIN EXTENDED
+SELECT SUBSTRING(1, (SELECT 1 FROM t1 a1 RIGHT OUTER JOIN t1 ON 0)) AS d
+FROM t1 WHERE 0 > ANY (SELECT @a FROM t1)';
+
+--error ER_SUBQUERY_NO_1_ROW
+EXECUTE s;
+
+DEALLOCATE PREPARE s;
+DROP TABLE t1;
+
+--echo #