[MDEV-13147] "Unknown column" error when using FULL JOIN with qualified field names Created: 2017-06-21  Updated: 2017-06-22  Resolved: 2017-06-22

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.0.10
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Pedro G. Acevedo Assignee: Sergei Golubchik
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

*nix



 Description   

Running a SELECT query with FULL JOIN fails when some of the field names are qualified with their table names. The same query with a LEFT JOIN executes fine.

Code to reproduce:

create table a(aa int);
create table b(bb int);
insert into a values (12);
insert into b values (12);

/* Returns one row. */
select a.aa from a left join b on aa = bb;

/* Fails with "Unknown column 'a.aa' in 'field list'" */
select a.aa from a full join b on aa = bb;

/* Returns one row. */
select aa from a left join b on a.aa = bb;

/* Fails with "Unknown column 'a.aa' in 'on clause'" */
select aa from a full join b on a.aa = bb;



 Comments   
Comment by Sergei Golubchik [ 2017-06-22 ]

This is not a bug. See the manual — there is no "FULL JOIN" in MariaDB, so when you specify a full join b, "full" is parsed as an alias for the table "a". That's why a full join b on a.aa = bb fails, but a full join b on full.aa = bb should work.

Comment by Pedro G. Acevedo [ 2017-06-22 ]

Thank you. I knew I was having a hard time finding information on full join for MariaDB, but did not think that it was interpreting "full" as an alias.

Generated at Thu Feb 08 08:03:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.