You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/04/17 13:13:21 UTC

[GitHub] [calcite] pengzhiwei2018 commented on a change in pull request #783: [CALCITE-2453] Adding support of SQL statements separated by a semicolon

pengzhiwei2018 commented on a change in pull request #783: [CALCITE-2453] Adding support of SQL statements separated by a semicolon
URL: https://github.com/apache/calcite/pull/783#discussion_r276231276
 
 

 ##########
 File path: core/src/main/codegen/templates/Parser.jj
 ##########
 @@ -937,6 +942,45 @@ SqlNode SqlQueryEof() :
     { return query; }
 }
 
+/**
+ * Parses a list of SQL statements separated by semicolon.
+ * The semicolon is required between statements, but is
+ * optional at the end.
+ */
+SqlNodeList SqlStmtList() :
+{
+    final List<SqlNode> stmtList = new ArrayList<SqlNode>();
+    SqlNode stmt;
+}
+{
+    stmt = SqlStmtWithSemiColon() {
+        stmtList.add(stmt);
+    }
 
 Review comment:
   In this statement, the follow sql  may pass the parser:
   `select * from a   select * from b`
   There is no ';' between the sql statements.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services