summaryrefslogtreecommitdiff
path: root/mysql-test/r/subselect_innodb.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/subselect_innodb.result')
-rw-r--r--mysql-test/r/subselect_innodb.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index bf97b9fc4eb..b311fa24eee 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -247,4 +247,28 @@ x
NULL
drop procedure p1;
drop tables t1,t2,t3;
+#
+# LP BUG#827416: Crash in select_describe() on EXPLAIN with DISTINCT in nested subqueries
+#
+CREATE TABLE t3 ( b int) ENGINE=InnoDB;
+CREATE TABLE t2 ( c int) ENGINE=InnoDB;
+CREATE TABLE t1 ( a int NOT NULL , PRIMARY KEY (a)) ENGINE=InnoDB;
+EXPLAIN SELECT *
+FROM t1
+WHERE t1.a = (
+SELECT SUM( c )
+FROM t2
+WHERE (SELECT DISTINCT b FROM t3) > 0);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using where; Using index
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 1
+3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary
+SELECT *
+FROM t1
+WHERE t1.a = (
+SELECT SUM( c )
+FROM t2
+WHERE (SELECT DISTINCT b FROM t3) > 0);
+a
+DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_innodb_tmp;