Open anhzhi opened 4 years ago
Input sql: from https://github.com/antlr/grammars-v4/blob/master/sql/plsql/examples/views.sql#L52
CREATE VIEW TEST (A, B, C) AS WITH TESTCTE AS ( SELECT 1 ONE FROM DUAL ) SELECT 'A', 'B', 'C' FROM DUAL JOIN TESTCTE;
when parsing it with the rule of sql_script: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlParser.g4#L32
sql_script : ((unit_statement | sql_plus_command) SEMICOLON?)* EOF ;
the result is not as expected:
grun PlSql sql_script -gui
The given sql is splitted into 2 clauses:
CREATE TABLE TEST AS WITH TESTCTE AS ( SELECT 1 ONE FROM DUAL ) SELECT 'A', 'B', 'C' FROM DUAL
and
JOIN TESTCTE;
While parsing it withrule of unit_statement: it works just as expected.
Hi! I am gonna see if I can work this weekend on checking whether this grammar fully conforms to the standard as I recently played around with the SQLite grammar and there were things missing there.
Input sql: from https://github.com/antlr/grammars-v4/blob/master/sql/plsql/examples/views.sql#L52
when parsing it with the rule of sql_script: https://github.com/antlr/grammars-v4/blob/master/sql/plsql/PlSqlParser.g4#L32
the result is not as expected:
The given sql is splitted into 2 clauses:
and
While parsing it withrule of unit_statement: it works just as expected.