mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Fix for BUG#4480: In joins with SELECT_STRAIGHT_JOIN re-order tables by outer join dependency,
so we read dependent tables after tables they depend on (this is needed for outer joins) mysql-test/r/join_outer.result: Test for BUG#4480 mysql-test/t/join_outer.test: Test for BUG#4480
This commit is contained in:
parent
de5ce11108
commit
1fc04e0b12
3 changed files with 57 additions and 10 deletions
|
|
@ -853,4 +853,19 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE t3 ALL NULL NULL NULL NULL 2
|
||||
drop table t1,t2;
|
||||
create table t1 (a int, b int);
|
||||
insert into t1 values (1,1),(2,2),(3,3);
|
||||
create table t2 (a int, b int);
|
||||
insert into t2 values (1,1), (2,2);
|
||||
select * from t2 right join t1 on t2.a=t1.a;
|
||||
a b a b
|
||||
1 1 1 1
|
||||
2 2 2 2
|
||||
NULL NULL 3 3
|
||||
select straight_join * from t2 right join t1 on t2.a=t1.a;
|
||||
a b a b
|
||||
1 1 1 1
|
||||
2 2 2 2
|
||||
NULL NULL 3 3
|
||||
DROP TABLE t0,t1,t2,t3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue