diff options
author | Igor Babaev <igor@askmonty.org> | 2011-07-20 16:09:28 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-07-20 16:09:28 -0700 |
commit | 57f4965f36b742f5b5abee0b31d20689916c43a8 (patch) | |
tree | 86497f4563ec306b977a5cc35c035bd6ac43b642 /mysql-test/t/subselect_mat.test | |
parent | 36be492dc00c6aeb1eed4e871c5b10383184f559 (diff) | |
download | mariadb-git-57f4965f36b742f5b5abee0b31d20689916c43a8.tar.gz |
Fixed LP bug #702301.
The function matching_cond should take into account that
there may be always false constant conjunctive conditions
that has not been evaluated yet,for example, conjunctive
conditions with non-correlated subqueries.
Diffstat (limited to 'mysql-test/t/subselect_mat.test')
-rw-r--r-- | mysql-test/t/subselect_mat.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_mat.test b/mysql-test/t/subselect_mat.test index bfdb2554de1..a70fb4783c5 100644 --- a/mysql-test/t/subselect_mat.test +++ b/mysql-test/t/subselect_mat.test @@ -202,3 +202,27 @@ SELECT (f1, f2, f3) NOT IN FROM t2; drop table t1, t2; + +--echo # +--echo # LPBUG#702301: MAX in select + always false WHERE with SQ +--echo # + +CREATE TABLE t1 (a int, b int, KEY (b)); +INSERT INTO t1 VALUES (3,1), (4,2); +CREATE TABLE t2 (a int); +INSERT INTO t2 VALUES (7), (8); + +set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off'; + +SELECT MAX(t1.b) AS max_res FROM t1 WHERE (9) IN (SELECT a FROM t2); +EXPLAIN EXTENDED +SELECT MAX(t1.b) AS max_res FROM t1 WHERE (9) IN (SELECT a FROM t2); + +set @@optimizer_switch='materialization=off,in_to_exists=on,semijoin=off'; + +SELECT MAX(t1.b) AS max_res FROM t1 WHERE (9) IN (SELECT a FROM t2); +EXPLAIN EXTENDED +SELECT MAX(t1.b) AS max_res FROM t1 WHERE (9) IN (SELECT a FROM t2); + +DROP TABLE t1,t2; + |