mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
join_nested.result, join_nested.test:
Added a teast case for bug #11284. sql_select.cc: Fixed bug #11284. Optimization with empty inner table currently cannot be used in the case of nested outer join.
This commit is contained in:
@@ -752,3 +752,21 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
|
||||
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
#
|
||||
# Test for bug #11284: empty table in a nested left join
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c11 int);
|
||||
CREATE TABLE t2 (c21 int);
|
||||
CREATE TABLE t3 (c31 int);
|
||||
|
||||
INSERT INTO t1 VALUES (4), (5);
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON c11=c21;
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
EXPLAIN SELECT * FROM t1 LEFT JOIN (t2 LEFT JOIN t3 ON c21=c31) ON c11=c21;
|
||||
|
||||
DROP TABLE t1,t2,t3;
|
||||
|
||||
Reference in New Issue
Block a user