wgy8283335 commented on a change in pull request #10381:
URL: https://github.com/apache/shardingsphere/pull/10381#discussion_r638374118



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -101,15 +101,27 @@ multipleTableNames
     ;
 
 select 
-    : unionClause
+    : selectSubquery forUpdateClause?
+    ;
+
+selectSubquery
+    : (queryBlock | selectUnionClause | parenthesisSelectSubquery) 
orderByClause? rowLimitingClause
+    ;
+
+selectUnionClause
+    : ((queryBlock | parenthesisSelectSubquery) orderByClause? 
rowLimitingClause) ((UNION ALL? | INTERSECT | MINUS) selectSubquery)+

Review comment:
       > When we add `?` to `rowLimitingClause`, ANTLR gives `rule 
selectUnionClause contains an optional block with at least one alternative that 
can match an empty string` warning. So I didn't add it. Shall I add it?
   As the definition of the 'rowLimitingClause' is below:
   ```
   rowLimitingClause
       : (OFFSET offset (ROW | ROWS))? (FETCH (FIRST | NEXT) (rowcount | 
percent PERCENT)? (ROW | ROWS) (ONLY | WITH TIES))?
       ;
   ```
   I think there is no need to add '?'.




-- 
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:
[email protected]


Reply via email to