jingshanglu edited a comment on pull request #10381: URL: https://github.com/apache/shardingsphere/pull/10381#issuecomment-854328765
> @jingshanglu when testing `execute` rule for those specific `SELECT` statements, ANTLR plugin parses them successfully like earlier. > >  > > I tried to parse those specific `SELECT` statements via `execute` rule to ensure whether they parse correctly or not. I couldn't able to find any error. Am I testing them correctly? @ThanoshanMV @tristaZero I tried it,The reason is that the `twoPhaseParse` function uses two `PredictionMode`, one is `SLL`, the other is `LL`, `SLL` is a kind of inaccurate `PredictionMode`, `LL` is no problem, So it's ok. ``` private ParseASTNode twoPhaseParse(final String sql) { SQLParser sqlParser = SQLParserFactory.newInstance(databaseType, sql); try { setPredictionMode((Parser) sqlParser, PredictionMode.SLL); return (ParseASTNode) sqlParser.parse(); } catch (final ParseCancellationException ex) { ((Parser) sqlParser).reset(); setPredictionMode((Parser) sqlParser, PredictionMode.LL); try { return (ParseASTNode) sqlParser.parse(); } catch (final ParseCancellationException e) { throw new SQLParsingException("You have an error in your SQL syntax"); } } } ``` -- 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]
