diff options
Diffstat (limited to 'mysql-test/t/subselect_innodb.test')
-rw-r--r-- | mysql-test/t/subselect_innodb.test | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 3e2914eaef4..27ec36854f4 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -1,5 +1,7 @@ -- source include/have_innodb.inc +# Note: the tests uses only non-semijoin subqueries so semi-join switch +# settings are not relevant. set @subselect_innodb_tmp=@@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; --disable_warnings @@ -250,5 +252,61 @@ INSERT INTO t1 VALUES ('2011-05-13', 0); SELECT * FROM t1 WHERE b < (SELECT CAST(a as date) FROM t1 GROUP BY a); DROP TABLE t1; -# Cleanups +--echo # +--echo # lp:827416 Crash in select_describe() on EXPLAIN with DISTINCT in nested subqueries +--echo # + +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); +SELECT * +FROM t1 +WHERE t1.a = ( + SELECT SUM( c ) + FROM t2 + WHERE (SELECT DISTINCT b FROM t3) > 0); + +DROP TABLE t1, t2, t3; + + +--echo # +--echo # lp:858148 Fourth crash in select_describe() with nested subqueries +--echo # + +CREATE TABLE t1 ( f1 int(11)) ENGINE=InnoDB; +CREATE TABLE t2 ( f1 int(11), f2 int(11), PRIMARY KEY (f1)) ; +CREATE TABLE t3 ( f3 int(11)) ENGINE=InnoDB; + +EXPLAIN +SELECT MAX( f1 ) FROM t2 +WHERE f2 >= ( + SELECT SUM( f1 ) + FROM t1 + WHERE EXISTS ( + SELECT f3 + FROM t3 + GROUP BY 1 + ) +); + +SELECT MAX( f1 ) FROM t2 +WHERE f2 >= ( + SELECT SUM( f1 ) + FROM t1 + WHERE EXISTS ( + SELECT f3 + FROM t3 + GROUP BY 1 + ) +); + +drop table t1, t2, t3; + set optimizer_switch=@subselect_innodb_tmp; |