summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-16 22:01:47 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-16 22:01:47 -0700
commit25c152018dceae35bf0d45de46a33a214048128c (patch)
treed9dfc7c5fff1c89abb2870b5a1086dedf24678c0 /mysql-test/t/select.test
parent752d5d022dd4e6f76338b4b57696d4eef29e1f6b (diff)
downloadmariadb-git-25c152018dceae35bf0d45de46a33a214048128c.tar.gz
Fixed bug mdev-4418.
After single row substitutions there might appear new equalities. They should be properly propagated to all AND/OR levels the WHERE condition. It's done now with an additional call of remove_eq_conds().
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 94e169821e9..c0e22cb8f4e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4372,4 +4372,21 @@ 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