diff options
author | Igor Babaev <igor@askmonty.org> | 2012-03-01 14:22:22 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-03-01 14:22:22 -0800 |
commit | 8b469eb5151cb1b7da00cee3a7b42c10bd7ff51e (patch) | |
tree | a2dd09bd1fd3ba15b098eebf8b581bef7664b212 /mysql-test/r/join.result | |
parent | 29b0b0b5de46c6950b8b53314c74f6f458ba1a98 (diff) | |
parent | 000deedf3b708681951af6a0629af89c1f5ee85a (diff) | |
download | mariadb-git-8b469eb5151cb1b7da00cee3a7b42c10bd7ff51e.tar.gz |
Merge 5.3->5.5.
Diffstat (limited to 'mysql-test/r/join.result')
-rw-r--r-- | mysql-test/r/join.result | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index d826fbe2aa7..bd661859929 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1277,6 +1277,55 @@ Handler_read_rnd_next 1 DROP TABLE t1, t2; End of 5.1 tests # +# Bug #43368: STRAIGHT_JOIN DOESN'T WORK FOR NESTED JOINS +# +create table t1(c1 int primary key, c2 char(10)) engine=myisam; +create table t2(c1 int primary key, c2 char(10), ref_t1 int) engine=myisam; +create table t3(c1 int primary key, c2 char(10), ref_t1 int) engine=myisam; +create table t4(c1 int primary key, c2 char(10), ref_t1 int) engine=myisam; +insert into t1 values(1,'a'); +insert into t2 values(1,'a', 1); +insert into t3 values(1,'a', 1); +insert into t3 values(2,'b',2); +insert into t4 values(1,'a', 1); +insert into t4 values(2,'a', 2); +insert into t4 values(3,'a', 3); +insert into t4 values(4,'a', 4); +insert into t1 values(2,'b'); +insert into t1 values(3,'c'); +EXPLAIN +SELECT * +FROM t4 JOIN +(t1 JOIN t3 ON t3.ref_t1=t1.c1 JOIN t2 ON t2.ref_t1=t1.c1) +ON t4.ref_t1=t1.c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 system NULL NULL NULL NULL 1 +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join) +EXPLAIN +SELECT STRAIGHT_JOIN * +FROM t4 JOIN +(t1 JOIN t3 ON t3.ref_t1=t1.c1 JOIN t2 ON t2.ref_t1=t1.c1) +ON t4.ref_t1=t1.c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 4 +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join) +EXPLAIN +SELECT * +FROM t4 STRAIGHT_JOIN +(t1 JOIN t3 ON t3.ref_t1=t1.c1 JOIN t2 ON t2.ref_t1=t1.c1) +ON t4.ref_t1=t1.c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where +1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t4.ref_t1 1 +1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +drop table t1,t2,t3,t4; +End of 5.2 tests +# # BUG#724275: Crash in JOIN::optimize in maria-5.3 # create table t1 (a int); |