[MDEV-13146] Syntax error when using FULL JOIN with table aliases 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   

A SELECT query that uses a FULL JOIN fails with a syntax error if you use table aliases in the query.

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 * from a full join b on aa = bb;

/* Fails with "check the manual that corresponds to your MariaDB server version for the right syntax to use near 'full join b b_alias on aa = bb' at line 1" */
select * from a a_alias full join b b_alias on 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". Naturally, a table cannot have two aliases, so a a_alias full join b is a syntax error.

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:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.