You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/01/20 06:59:26 UTC

[GitHub] [incubator-shardingsphere] tuohai666 opened a new pull request #4045: #4042, Use the two-stage parsing strategy

tuohai666 opened a new pull request #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045
 
 
   Fixes #4042.

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] coveralls commented on issue #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045#issuecomment-576142335
 
 
   ## Pull Request Test Coverage Report for [Build 1436](https://coveralls.io/builds/28204130)
   
   * **0** of **10**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * No unchanged relevant lines lost coverage.
   * Overall coverage decreased (**-0.04%**) to **66.755%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserEngine.java](https://coveralls.io/builds/28204130/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2Fparser%2FSQLParserEngine.java#L60) | 0 | 10 | 0.0%
   <!-- | **Total:** | **0** | **10** | **0.0%** | -->
   
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28204130/badge)](https://coveralls.io/builds/28204130) |
   | :-- | --: |
   | Change from base [Build 711](https://coveralls.io/builds/28203081): |  -0.04% |
   | Covered Lines: | 10815 |
   | Relevant Lines: | 16201 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] terrymanu merged pull request #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045
 
 
   

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] coveralls edited a comment on issue #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on issue #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045#issuecomment-576142335
 
 
   ## Pull Request Test Coverage Report for [Build 1439](https://coveralls.io/builds/28204607)
   
   * **0** of **10**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * **54** unchanged lines in **1** file lost coverage.
   * Overall coverage decreased (**-0.05%**) to **66.747%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserEngine.java](https://coveralls.io/builds/28204607/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2Fparser%2FSQLParserEngine.java#L60) | 0 | 10 | 0.0%
   <!-- | **Total:** | **0** | **10** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java](https://coveralls.io/builds/28204607/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLVisitor.java#L147) | 54 | 0% |
   <!-- | **Total:** | **54** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28204607/badge)](https://coveralls.io/builds/28204607) |
   | :-- | --: |
   | Change from base [Build 711](https://coveralls.io/builds/28203081): |  -0.05% |
   | Covered Lines: | 10815 |
   | Relevant Lines: | 16203 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] terrymanu commented on a change in pull request #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045#discussion_r368395769
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserEngine.java
 ##########
 @@ -51,7 +57,18 @@
      * @return abstract syntax tree of SQL
      */
     public SQLAST parse() {
-        ParseTree parseTree = SQLParserFactory.newInstance(databaseTypeName, sql).execute().getChild(0);
+        SQLParser sqlParser = SQLParserFactory.newInstance(databaseTypeName, sql);
+        ParseTree parseTree;
+        try {
+            ((Parser) sqlParser).setErrorHandler(new BailErrorStrategy());
+            ((Parser) sqlParser).getInterpreter().setPredictionMode(PredictionMode.SLL);
+            parseTree = sqlParser.execute().getChild(0);
+        } catch (ParseCancellationException ex) {
 
 Review comment:
   should add final for exception catch

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] tuohai666 commented on a change in pull request #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
tuohai666 commented on a change in pull request #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045#discussion_r368399168
 
 

 ##########
 File path: shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserEngine.java
 ##########
 @@ -51,7 +57,18 @@
      * @return abstract syntax tree of SQL
      */
     public SQLAST parse() {
-        ParseTree parseTree = SQLParserFactory.newInstance(databaseTypeName, sql).execute().getChild(0);
+        SQLParser sqlParser = SQLParserFactory.newInstance(databaseTypeName, sql);
+        ParseTree parseTree;
+        try {
+            ((Parser) sqlParser).setErrorHandler(new BailErrorStrategy());
+            ((Parser) sqlParser).getInterpreter().setPredictionMode(PredictionMode.SLL);
+            parseTree = sqlParser.execute().getChild(0);
+        } catch (ParseCancellationException ex) {
 
 Review comment:
   fixed

----------------------------------------------------------------
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

[GitHub] [incubator-shardingsphere] coveralls edited a comment on issue #4045: #4042, Use the two-stage parsing strategy

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on issue #4045: #4042, Use the two-stage parsing strategy
URL: https://github.com/apache/incubator-shardingsphere/pull/4045#issuecomment-576142335
 
 
   ## Pull Request Test Coverage Report for [Build 1437](https://coveralls.io/builds/28204413)
   
   * **0** of **10**   **(0.0%)**  changed or added relevant lines in **1** file are covered.
   * **54** unchanged lines in **1** file lost coverage.
   * Overall coverage decreased (**-0.05%**) to **66.747%**
   
   ---
   
   |  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
   | :-----|--------------|--------|---: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/parser/SQLParserEngine.java](https://coveralls.io/builds/28204413/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-engine%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2Fcore%2Fparser%2FSQLParserEngine.java#L60) | 0 | 10 | 0.0%
   <!-- | **Total:** | **0** | **10** | **0.0%** | -->
   
   |  Files with Coverage Reduction | New Missed Lines | % |
   | :-----|--------------|--: |
   | [shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java](https://coveralls.io/builds/28204413/source?filename=shardingsphere-sql-parser%2Fshardingsphere-sql-parser-mysql%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fshardingsphere%2Fsql%2Fparser%2FMySQLVisitor.java#L147) | 54 | 0% |
   <!-- | **Total:** | **54** |  | -->
   
   |  Totals | [![Coverage Status](https://coveralls.io/builds/28204413/badge)](https://coveralls.io/builds/28204413) |
   | :-- | --: |
   | Change from base [Build 711](https://coveralls.io/builds/28203081): |  -0.05% |
   | Covered Lines: | 10815 |
   | Relevant Lines: | 16203 |
   
   ---
   ##### 💛  - [Coveralls](https://coveralls.io)
   

----------------------------------------------------------------
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