RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
COUNT(*)
476
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t1 TA1
RIGHT JOIN t2 TA2 JOIN t2 TA3 ON TA2.f1 ON TA3.f1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE TA2 ALL NULL NULL NULL NULL 20 Using where
1 SIMPLE TA3 ALL NULL NULL NULL NULL 20 Using join buffer
1 SIMPLE TA1 ALL NULL NULL NULL NULL 2
DROP TABLE t1, t2;
#
# Bug#48971 Segfault in add_found_match_trig_cond () at sql_select.cc:5990
#
CREATE TABLE t1(f1 INT, PRIMARY KEY (f1));
INSERT INTO t1 VALUES (1),(2);
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1
LEFT JOIN t1 AS T2
RIGHT JOIN t1 AS T3
JOIN t1 AS T4 ON 1
LEFT JOIN t1 AS T5 ON 1
ON 1
RIGHT JOIN t1 AS T6 ON T6.f1
ON 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index
Warnings:
Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T1` left join (`test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1))) on(1) where 1
EXPLAIN EXTENDED SELECT STRAIGHT_JOIN T1.f1 FROM t1 AS T1
RIGHT JOIN t1 AS T2
RIGHT JOIN t1 AS T3
JOIN t1 AS T4 ON 1
LEFT JOIN t1 AS T5 ON 1
ON 1
RIGHT JOIN t1 AS T6 ON T6.f1
ON 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE T6 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T3 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T4 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T5 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T2 index NULL PRIMARY 4 NULL 2 100.00 Using index
1 SIMPLE T1 index NULL PRIMARY 4 NULL 2 100.00 Using index
Warnings:
Note 1003 select straight_join `test`.`T1`.`f1` AS `f1` from `test`.`t1` `T6` left join (`test`.`t1` `T3` join `test`.`t1` `T4` left join `test`.`t1` `T5` on(1) left join `test`.`t1` `T2` on(1)) on((`test`.`T6`.`f1` and 1)) left join `test`.`t1` `T1` on(1) where 1