ThanoshanMV commented on a change in pull request #10381:
URL: https://github.com/apache/shardingsphere/pull/10381#discussion_r635386640
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -101,15 +101,19 @@ multipleTableNames
;
select
- : unionClause
+ : selectSubquery forUpdateClause?
+ ;
+
+selectSubquery
+ : (selectClause | selectClause ((UNION ALL? | INTERSECT | MINUS)
selectSubquery)+ | LP_ selectSubquery RP_) orderByClause? rowLimitingClause
Review comment:
To resolve the mutually left-recursive error, I tried with this
definition:
```
select
: selectSubquery forUpdateClause?
;
selectSubquery
: (queryBlock | selectUnionClause | parenthesisSelectSubquery)
orderByClause? rowLimitingClause
;
selectUnionClause
: ((queryBlock | parenthesisSelectSubquery) orderByClause?
rowLimitingClause) ((UNION ALL? | INTERSECT | MINUS) selectSubquery)+
;
parenthesisSelectSubquery
: LP_ selectSubquery RP_
;
```
It worked without that error. Because of mutually left-recursive error, I
didn't add `selectUnionClause` in `selectUnionClause`'s definition and only
specified `(queryBlock | parenthesisSelectSubquery)`.
--
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]