diff options
author | Igor Babaev <igor@askmonty.org> | 2013-08-15 14:16:16 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2013-08-15 14:16:16 -0700 |
commit | fa7f677218ae5ed38ef37b7b61140a069c1f8a44 (patch) | |
tree | 2905baae141ddd47997cf82e4ee80b110dcff6ee /mysql-test/t | |
parent | 8a732d5a5eeb29b9fea1814cabcf083b55428939 (diff) | |
download | mariadb-git-fa7f677218ae5ed38ef37b7b61140a069c1f8a44.tar.gz |
Fixed bug mdev-4355.
This patch almost totally revised the patch for bug mdev-4177.
The latter had too many defects. In particular, it did not
propagate multiple equalities formed when merging a degenerate
disjunct into underlying AND formula.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/select.test | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 54168332664..94e169821e9 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4326,7 +4326,7 @@ SELECT * FROM t1 INNER JOIN t2 ON ( c = a ) DROP TABLE t1,t2; --echo # ---echo # Bug mdev-4413: another manifestations of bug mdev-2474 +--echo # Bug mdev-4413: another manifestations of bug mdev-4274 --echo # (valgrind complains) --echo # @@ -4342,4 +4342,34 @@ SELECT * FROM t1, t2 DROP TABLE t1, t2; +--echo # +--echo # Bug mdev-4355: equalities from the result of simplification of OR +--echo # are not propagated to lower AND levels +--echo # + +CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1,101),(2,102),(3,103),(4,104),(5,11); + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); +SELECT * FROM t1 WHERE (1 != 1 OR a = 5) AND (b != 1 OR a = 1); + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); +SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (1 != 1 OR a = 5); + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); +SELECT * FROM t1 WHERE (b != 1 OR a = 1) AND (a = 5 OR 1 != 1); + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (b = 1 OR a = 1) AND (b = 5 AND a = 5 OR 1 != 1); +SELECT * FROM t1 WHERE (b = 1 OR a = 1) AND (b = 5 AND a = 5 OR 1 != 1); + +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); +SELECT * FROM t1 WHERE (b = 1 OR a = 5) AND (b = 5 AND a = 5 OR 1 != 1); + +DROP TABLE t1; + --echo End of 5.3 tests |