summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-18 19:58:51 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-18 19:58:51 -0700
commit4eddb2c221d086d7181ef7ff78bb0e6ce6f3359a (patch)
treed1b3c7ebc6b5149a4111176c53ce112a7585ae21 /mysql-test/t/select.test
parentb59738a598569ace75be5e63b7ed6ca69afe6ebc (diff)
parent25c152018dceae35bf0d45de46a33a214048128c (diff)
downloadmariadb-git-4eddb2c221d086d7181ef7ff78bb0e6ce6f3359a.tar.gz
Merge 5.3->5.5.
In particular: Merged the patch for bug mdev-4418 from 5.3 into 5.5. Fixed a bug in the patch that should be backported to 5.3.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test49
1 files changed, 48 insertions, 1 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 6a82a2901c5..0c28afafdd9 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4500,7 +4500,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 #
@@ -4516,5 +4516,52 @@ 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 #
+--echo # Bug mdev-4418: impossible multiple equality in OR formula
+--echo # after row substitution
+--echo #
+
+CREATE TABLE t1 (a int, b varchar(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (0,'j'), (8,'v');
+
+CREATE TABLE t2 (c varchar(1), d varchar(1)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('k','k');
+
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b));
+SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b));
+
+DROP TABLE t1,t2;
+
--echo End of 5.3 tests