Skip to content

Commit

Permalink
feat: add error syntax test case for last join without on/using clause
Browse files Browse the repository at this point in the history
  • Loading branch information
jingchen2222 committed May 14, 2021
1 parent 761419f commit e94b6db
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion zetasql/parser/testdata/from.test
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,8 @@ select * from A, B JOIN (C, D)
==

# RIGHT JOIN and FULL JOIN require parentheses when following a comma join.
select * FROM A, B {{INNER|CROSS|LEFT|RIGHT|FULL}} JOIN C
# LAST JOIN require to be followed by ON/USING clause
select * FROM A, B {{INNER|CROSS|LEFT|RIGHT|FULL|LAST}} JOIN C
--
ALTERNATION GROUP: INNER
--
Expand Down Expand Up @@ -1070,6 +1071,13 @@ ALTERNATION GROUP: FULL
ERROR: Syntax error: FULL JOIN must be parenthesized when following a comma join. Also, if the preceding comma join is a correlated CROSS JOIN that unnests an array, then CROSS JOIN syntax must be used in place of the comma join [at 1:20]
select * FROM A, B FULL JOIN C
^

--
ALTERNATION GROUP: LAST
--
ERROR: Syntax error: Expected keyword ON or keyword USING but got end of statement [at 1:31]
select * FROM A, B LAST JOIN C
^
==

# Comma join error happens even after chains of other joins.
Expand Down

0 comments on commit e94b6db

Please sign in to comment.