diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2010-03-13 23:04:52 +0300 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2010-03-13 23:04:52 +0300 |
commit | 02e9fa62e70e6074850356fb1e24880d64073fda (patch) | |
tree | aa962c91fce3d7dbec29bff2bdc9e4d564493f5b /mysql-test/t/subselect_mat.test | |
parent | c2924e155e2b8edaec11cc08f37fd0201e5a23d8 (diff) | |
download | mariadb-git-02e9fa62e70e6074850356fb1e24880d64073fda.tar.gz |
BUG#45174: XOR in subqueries produces differing results in 5.1 and 5.4
BUG#50019: Wrong result for IN-subquery with materialization
- Fix equality substitution in presense of semi-join materialization, lookup and scan variants
(started off from fix by Evgen Potemkin, then modified it to work in all cases)
Diffstat (limited to 'mysql-test/t/subselect_mat.test')
-rw-r--r-- | mysql-test/t/subselect_mat.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/subselect_mat.test b/mysql-test/t/subselect_mat.test index 71b453057f0..54b1b5e15f9 100644 --- a/mysql-test/t/subselect_mat.test +++ b/mysql-test/t/subselect_mat.test @@ -889,3 +889,19 @@ SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); SELECT pk FROM t1 WHERE (b,c,d) IN (SELECT b,c,d FROM t2 WHERE pk > 0); DROP TABLE t1, t2; +--echo # +--echo # BUG#50019: Wrong result for IN-subquery with materialization +--echo # +create table t1(i int); +insert into t1 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +create table t2(i int); +insert into t2 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +create table t3(i int); +insert into t3 values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); +select * from t1 where t1.i in (select t2.i from t2 join t3 where t2.i + t3.i = 5); +set @save_optimizer_switch=@@optimizer_switch; +set session optimizer_switch='materialization=off'; +select * from t1 where t1.i in (select t2.i from t2 join t3 where t2.i + t3.i = 5); +set session optimizer_switch=@save_optimizer_switch; +drop table t1, t2, t3; + |