diff options
author | Igor Babaev <igor@askmonty.org> | 2011-03-12 00:49:03 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-03-12 00:49:03 -0800 |
commit | 81316aac3a5588da2304696754aa61e7be9853ca (patch) | |
tree | 670f2b1b5c835e96913db98d4f71e6b7d2f0102d /mysql-test/r/join.result | |
parent | 546a166b4e1a52d63694caa38bc737e18fd8e98b (diff) | |
download | mariadb-git-81316aac3a5588da2304696754aa61e7be9853ca.tar.gz |
Fixed LP bugs BUG#729067/730466.
Do not reset the value of the item_equal field in the Item_field object
once it has been set.
Diffstat (limited to 'mysql-test/r/join.result')
-rw-r--r-- | mysql-test/r/join.result | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index 749e58df26f..935e3ee3b62 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1285,3 +1285,38 @@ a b a a b 1 1 1 1 1 1 1 1 1 1 drop table t1,t2,t3; +# +# BUG#729067/730466: unexpected 'Range checked for each record' +# for queries with OR in WHERE clause +# +CREATE TABLE t1 (f1 int, f2 int) ; +INSERT INTO t1 VALUES (4,0),(5,1); +CREATE TABLE t2 (f1 int, f2 int, KEY (f2)) ; +INSERT INTO t2 VALUES (5,7), (8,9); +EXPLAIN +SELECT * FROM t1 STRAIGHT_JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1<>0 OR t1.f2<>0 AND t1.f1 = t2.f2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t2 ALL f2 NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +SELECT * FROM t1 STRAIGHT_JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1<>0 OR t1.f2<>0 AND t1.f1 = t2.f2; +f1 f2 f1 f2 +5 1 5 7 +DROP TABLE t1,t2; +CREATE TABLE t1(f1 int PRIMARY KEY, f2 int) ; +INSERT INTO t1 VALUES (9,4), (10,9); +CREATE TABLE t2(f1 int PRIMARY KEY, f2 int) ; +INSERT INTO t2 VALUES (9,4), (10,9); +EXPLAIN +SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON t2.f2 = t1.f1 +WHERE t1.f1 IN (SELECT f1 FROM t1) AND t1.f1 = t2.f1 OR t1.f1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 Using where +1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +2 SUBQUERY t1 index NULL PRIMARY 4 NULL 2 Using index +SELECT STRAIGHT_JOIN * FROM t1 JOIN t2 ON t2.f2 = t1.f1 +WHERE t1.f1 IN (SELECT f1 FROM t1) AND t1.f1 = t2.f1 OR t1.f1 = 9; +f1 f2 f1 f2 +9 4 10 9 +DROP TABLE t1,t2; |