summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-08-26 12:55:58 -0700
committerIgor Babaev <igor@askmonty.org>2013-08-26 12:55:58 -0700
commit901737c9782215e409ae6f7869f5d0adbe215ad6 (patch)
treed95324308b0c054ebe366be14124045cf8148fa7 /mysql-test/t/select.test
parentdbc84ff96c021f9d8b5968812a416bc6890d015a (diff)
downloadmariadb-git-901737c9782215e409ae6f7869f5d0adbe215ad6.tar.gz
Fixed bug mdev-4944.
The patch to fix mdev-4418 turned out to be incorrect. At the substitution of single row tables in make_join_statistics() the used multiple equalities may change and references to the new multiple equalities must be updated. The function remove_eq_conds() takes care of it and it should be called right after the substitution of single row tables. Calling it after the call of make_join_statistics was a mistake.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index c0e22cb8f4e..bb5a6b9c2fc 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -4389,4 +4389,23 @@ SELECT * FROM t1, t2 WHERE c=b AND (1=2 OR ((b='h' OR a=136) AND d=b));
DROP TABLE t1,t2;
+--echo #
+--echo # Bug mdev-4944: range conditition in OR formula with fields
+--echo # belonging to multiple equalities
+--echo #
+
+CREATE TABLE t1 (i1 int, j1 int) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,8);
+
+CREATE TABLE t2 (i2 int, INDEX idx (i2)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (8), (9);
+
+EXPLAIN EXTENDED
+SELECT * FROM t1, t2
+ WHERE i1 = i2 AND ( FALSE OR ( j1 > 27 AND j1 < 100 OR j1 <= 3 ) AND j1 = i2 );
+SELECT * FROM t1, t2
+ WHERE i1 = i2 AND ( FALSE OR ( j1 > 27 AND j1 < 100 OR j1 <= 3 ) AND j1 = i2 );
+
+DROP TABLE t1,t2;
+
--echo End of 5.3 tests