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/11/08 12:09:55 UTC

[GitHub] [shardingsphere] lwtdev opened a new pull request #8077: Fix parse problem in delete multi table statement and select into sta…

lwtdev opened a new pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077


   Fixes #7978.
   * Fix parse problem in delete multi table statement and select into statement
     * Added missing logic for selectWithInto when visit select.
     * Added test cases for select-into statements; case 'select_into_out_file_with_fields_and_escaped' and 
       'select_into_with_lock_before_into' are supported in MySQL 8.0 but not in MySQL 5.7.
     * Table names should split with COMMA_ (',') in multipleTablesClause.
     * Added test cases for delete multi table 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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519397704



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @lwtdev Maybe change `tableAliasRefList` will be best. and delete unused rule `multipleTableNames`, because the name in MySQL source code is `tableAliasRefList`.
   ```
   tableAliasRefList
       : tableIdentOptWild (COMMA_ tableIdentOptWild)*
       ;
   ```




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



[GitHub] [shardingsphere] codecov-io commented on pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#issuecomment-723573127


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=h1) Report
   > Merging [#8077](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=desc) (35e9507) into [5.0.0-alpha-release](https://codecov.io/gh/apache/shardingsphere/commit/3a65916fa04be94d12f91c3b5b64f67014e5f442?el=desc) (3a65916) will **not change** coverage.
   > The diff coverage is `66.66%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/8077/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=tree)
   
   ```diff
   @@                  Coverage Diff                   @@
   ##             5.0.0-alpha-release    #8077   +/-   ##
   ======================================================
     Coverage                  75.02%   75.02%           
     Complexity                   535      535           
   ======================================================
     Files                       1426     1426           
     Lines                      22508    22516    +8     
     Branches                    4033     4036    +3     
   ======================================================
   + Hits                       16886    16892    +6     
   - Misses                      4525     4526    +1     
   - Partials                    1097     1098    +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...sitor/statement/impl/MySQLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/8077/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1teXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9teXNxbC92aXNpdG9yL3N0YXRlbWVudC9pbXBsL015U1FMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.08% <66.66%> (-0.05%)` | `1.00 <0.00> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=footer). Last update [3a65916...35e9507](https://codecov.io/gh/apache/shardingsphere/pull/8077?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


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



[GitHub] [shardingsphere] tristaZero closed pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
tristaZero closed pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077


   


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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519420275



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu I think `tableLockingList` should be part of `lockClause`. but this change need more test case . so I will keep `tableLockingList`  and not modify `lockClause`. what do you think ?




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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519584508



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       > 1. fix `lockCl`
   
   @lwtdev 
   
   1. In this PR, fix the definition of `lockClause` at the same time.
   2. Create another PR that contains the same content as this PR(target branch:master)




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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519525322



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       SourceCode:
   ![image](https://user-images.githubusercontent.com/16559542/98494775-b602f880-2278-11eb-963f-a98aa333ba7a.png)
   




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



[GitHub] [shardingsphere] lwtdev commented on pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#issuecomment-723592500


   @jingshanglu  Hi, I just replaced `multipleTableNames` with `tableAliasRefList`.


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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519638612



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu ok




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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519563925



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @lwtdev Yes.




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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519420275



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu I think `tableLockingList` should be add to `lockClause`. but this change need more test case . so I will keep `tableLockingList`  and not modify `lockClause`. what do you think ?




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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519407755



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu  Thanks very much for you advice. I will change it. 
   What about `tableLockingList` that references ` tableAliasRefList`. Could I remove it , too? It's unused , but I don't know why this was added.
   ```
   tableLockingList
       : OF tableAliasRefList
       ;
   ```




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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519564426



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @lwtdev plz fix the definition of `lockClause` by the way.




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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519535346



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu Hi, do you means repush this pr to master branch or create another pr for the `table_locking_list` issue ?




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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
jingshanglu commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519524261



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       > @jingshanglu I think `tableLockingList` should be part of `lockClause`. but this change need more test case . so I will keep `tableLockingList` and not modify `lockClause` this time. what do you think ?
   
   @lwtdev I checked the actual grammar rules([MySQL Source Code](https://github.com/mysql/mysql-server/blob/8.0/sql/sql_yacc.yy)), the `lockClause` rule should like this:
   ```
   lockClause
       : FOR lockStrength tableLockingList? lockedRowAction?
       | LOCK IN SHARE MODE
       ;
   ```
   Change it by the way.
   
   And then can you create PR to master branch?




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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519420275



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu I think `tableLockingList` should be part of `lockClause`. but this change need more test case . so I will keep `tableLockingList`  and not modify `lockClause` this time. what do you think ?




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



[GitHub] [shardingsphere] lwtdev commented on a change in pull request #8077: Fix parse problem in delete multi table statement and select into sta…

Posted by GitBox <gi...@apache.org>.
lwtdev commented on a change in pull request #8077:
URL: https://github.com/apache/shardingsphere/pull/8077#discussion_r519571192



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
##########
@@ -105,11 +105,11 @@ singleTableClause
     ;
 
 multipleTablesClause
-    : tableAliasRefList FROM tableReferences | FROM tableAliasRefList USING tableReferences
+    : multipleTableNames FROM tableReferences | FROM multipleTableNames USING tableReferences
     ;
 
 multipleTableNames
-    : tableName DOT_ASTERISK_? (COMMA_ tableName DOT_ASTERISK_?)*
+    : tableIdentOptWild (COMMA_ tableIdentOptWild)*
     ;

Review comment:
       @jingshanglu  I cannot get your point...
   1. fix `lockClause` issue at the same time and repush this pr to master.
   2. keep this pr (target branch : apache:5.0.0-alpha-release), then create another pr to fix `lockClause` issue (target branch: master)




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