mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-20265 Unknown column in field list
This patch corrects the fix of the patch for mdev-19421 that resolved the problem of parsing some embedded join expressions such as t1 join t2 left join t3 on t2.a=t3.a on t1.a=t2.a. Yet the patch contained a bug that prevented proper context analysis of the queries where such expressions were used together with comma separated table references in from clauses.
This commit is contained in:
@ -1613,6 +1613,65 @@ eval $q;
|
||||
|
||||
drop table t1,t2,t3,t4,s1,s2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-20265: Mix of comma joins with JOIN expressions
|
||||
--echo # (correction of the fix for MDEV-19421)
|
||||
--echo # MDEV-20330: duplicate
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (7), (5), (3);
|
||||
create table t2 (a int);
|
||||
insert into t2 values (5), (1), (7);
|
||||
create table t3 (a int);
|
||||
insert into t3 values (2), (7), (3);
|
||||
create table t4 (a int);
|
||||
insert into t4 values (4), (7), (9), (5);
|
||||
create table t5 (a int);
|
||||
insert into t5 values (3), (7), (9), (2);
|
||||
|
||||
|
||||
let $q=
|
||||
select t1.a as t1_a, t2.a as t2_a, t3.a as t3_a, t4.a as t4_a
|
||||
from t1, t2 join t3 left join t4 on t3.a=t4.a;
|
||||
eval explain extended $q;
|
||||
eval $q;
|
||||
|
||||
let $q=
|
||||
select t1.a as t1_a, t2.a as t2_a, t3.a as t3_a, t4.a as t4_a
|
||||
from t1, t2 join t3 right join t4 on t3.a=t4.a;
|
||||
eval explain extended $q;
|
||||
eval $q;
|
||||
|
||||
let $q=
|
||||
select t1.a as t1_a, t2.a as t2_a, t3.a as t3_a, t4.a as t4_a, t5.a as t5_a
|
||||
from t1, t2 join t3 join t4 left join t5 on t4.a=t5.a;
|
||||
eval explain extended $q;
|
||||
eval $q;
|
||||
|
||||
let $q=
|
||||
select t1.a as t1_a, t2.a as t2_a, t3.a as t3_a, t4.a as t4_a, t5.a as t5_a
|
||||
from t1, t2 join t3 join t4 right join t5 on t4.a=t5.a;
|
||||
eval explain extended $q;
|
||||
eval $q;
|
||||
|
||||
let $q=
|
||||
select t1.a as t1_a, t2.a as t2_a, t3.a as t3_a, t4.a as t4_a, t5.a as t5_a
|
||||
from t1 left join t2 on t1.a=t2.a, t3 join t4 right join t5 on t4.a=t5.a;
|
||||
eval explain extended $q;
|
||||
eval $q;
|
||||
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
||||
select a.a
|
||||
from (select 1 as a) a,
|
||||
(select 2 as b) b
|
||||
cross join
|
||||
(select 3 as c) c
|
||||
left join
|
||||
(select 4 as d) d
|
||||
on 1;
|
||||
|
||||
--echo #
|
||||
--echo # End of MariaDB 5.5 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user