diff options
author | unknown <timour@askmonty.org> | 2011-11-28 15:24:07 +0200 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2011-11-28 15:24:07 +0200 |
commit | 62e7ab3ac7a7dc6c89308f9883610d9951d85a73 (patch) | |
tree | a9c1159699310319954dabdbb3d0deb242b33d4e /mysql-test/r/subselect_no_scache.result | |
parent | 5412e82c01aa126448af8c64279e2cb9a7ffdd38 (diff) | |
download | mariadb-git-62e7ab3ac7a7dc6c89308f9883610d9951d85a73.tar.gz |
Fix bugs lp:833777, lp:894397
Analysis:
lp:894397 was a consequence of a prior incorrect fix of lp:833777
which didn't take into account that even when all tables are
constant there may be correlated conditions, and the where clause
is not equivalent to the constant conditions.
Solution:
When there are constant tables only, evaluate only the conditions
that reference outer fields, because the constant conditions are
already checked, and the where clause doesn't have other conditions
than constant ones, and outer referencing ones. The fix for
lp:894397 also fixes lp:833777.
Diffstat (limited to 'mysql-test/r/subselect_no_scache.result')
-rw-r--r-- | mysql-test/r/subselect_no_scache.result | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 2674c651002..ef1b268f5ba 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -5690,8 +5690,21 @@ set @@optimizer_switch='in_to_exists=on,semijoin=off,materialization=off,subquer select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1 where a in (select a from t1))))))))))))))))))))))))))))); a 1 +set @@optimizer_switch=@subselect_tmp; drop table t1; # +# LP BUG#894397 Wrong result with in_to_exists, constant table , semijoin=OFF,materialization=OFF +# +CREATE TABLE t1 (a varchar(3)); +INSERT INTO t1 VALUES ('AAA'),('BBB'); +CREATE TABLE t2 (a varchar(3)); +INSERT INTO t2 VALUES ('CCC'); +set @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquery_cache=off'; +SELECT * FROM t1 WHERE t1.a IN (SELECT t2.a FROM t2 WHERE t2.a < 'ZZZ'); +a +set @@optimizer_switch=@subselect_tmp; +drop table t1, t2; +# # LP bug #859375: Assertion `0' failed in st_select_lex_unit::optimize # with view , UNION and prepared statement (rewriting fake_select # condition). |