mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#13832 - Unknown column t1.a in 'on clause'.
The cause for the bug is that the priorities of all rules/terminals that process the FROM clause are not fully specified, and the parser generator produces a parser that doesn't always parse the FROM clause so that JOINs are left-associative. As a result the final join tree produced by the parser is incorrect, which is the cause for subsequent name resolution to fail.
This commit is contained in:
@ -3124,3 +3124,15 @@ from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id;
|
||||
count(*)
|
||||
6
|
||||
drop table t1,t2,t3;
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
select * from t1 join t2 join t3 on (t1.a=t3.c);
|
||||
a b c
|
||||
select * from t1 join t2 left join t3 on (t1.a=t3.c);
|
||||
a b c
|
||||
select * from t1 join t2 right join t3 on (t1.a=t3.c);
|
||||
a b c
|
||||
select * from t1 join t2 straight_join t3 on (t1.a=t3.c);
|
||||
a b c
|
||||
drop table t1, t2 ,t3;
|
||||
|
@ -2649,3 +2649,17 @@ select count(*)
|
||||
from t1 inner join (t2 right join t3 on t2.id = t3.b_id) on t1.id = t3.a_id;
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# Bug #13832 Incorrect parse order of join productions due to unspecified
|
||||
# operator priorities results in incorrect join tree.
|
||||
#
|
||||
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
create table t3 (c int);
|
||||
select * from t1 join t2 join t3 on (t1.a=t3.c);
|
||||
select * from t1 join t2 left join t3 on (t1.a=t3.c);
|
||||
select * from t1 join t2 right join t3 on (t1.a=t3.c);
|
||||
select * from t1 join t2 straight_join t3 on (t1.a=t3.c);
|
||||
drop table t1, t2 ,t3;
|
||||
|
Reference in New Issue
Block a user