You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "zihaoAK47 (via GitHub)" <gi...@apache.org> on 2023/06/14 02:26:18 UTC

[GitHub] [shardingsphere] zihaoAK47 opened a new pull request, #26332: Support engine parse for mysql

zihaoAK47 opened a new pull request, #26332:
URL: https://github.com/apache/shardingsphere/pull/26332

   Refer #25535.
   
   Changes proposed in this pull request:
     - Add engine lexical rules
     - Modify engnameRef syntax rules
     - Add parsing and testing
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ✓] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ✓] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ✓] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ✓] I have added corresponding unit tests for my changes.
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #26332: Support engine parse for mysql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on code in PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#discussion_r1255640939


##########
parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/Keyword.g4:
##########
@@ -108,14 +108,58 @@ AUTOCOMMIT
     : A U T O C O M M I T
     ;
 
-INNODB
-    : 'INNODB'
-    ;
-
 REDO_LOG
     : 'REDO_LOG'
     ;
     
 DELIMITER
     : D E L I M I T E R
     ;
+
+ARCHIVE
+    : A R C H I V E
+    ;
+
+BLACKHOLE
+    : B L A C K H O L E
+    ;
+
+CSV
+    : C S V
+    ;
+
+FEDERATED
+    : F E D E R A T E D
+    ;
+
+INNODB
+    : I N N O D B
+    ;
+
+MEMORY
+    : M E M O R Y
+    ;
+
+MRG_MYISAM
+    : M R G UL_ M Y I S A M
+    ;
+
+MYISAM
+    : M Y I S A M
+    ;
+
+NDB
+    : N D B
+    ;
+
+NDBCLUSTER
+    : N D B C L U S T E R
+    ;
+
+PERFORMANCE_SCHEMA
+    : P E R F O R M A N C E UL_ S C H E M A
+    ;
+
+TOKUDB
+    : T O K U D B
+    ;

Review Comment:
   Please add new line at the end of file.



##########
parser/sql/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatVisitorIT.java:
##########
@@ -76,23 +76,23 @@ public Stream<? extends Arguments> provideArguments(final ExtensionContext exten
                                     + "`runoob_test` NATIONAL CHAR(40),\n"
                                     + "`submission_date` DATE,\n"
                                     + "PRIMARY KEY (`runoob_id`)\n"
-                                    + ")ENGINE=InnoDB DEFAULT CHARSET=utf8;",
+                                    + ")ENGINE=INNODB DEFAULT CHARSET=utf8;",

Review Comment:
   Why modify InnoDB to INNODB?



##########
parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDDLStatementVisitor.java:
##########
@@ -260,6 +262,13 @@ public ASTNode visitCreateTable(final CreateTableContext ctx) {
         if (null != ctx.createLikeClause()) {
             result.setLikeTable((SimpleTableSegment) visit(ctx.createLikeClause()));
         }
+        if (null != ctx.createTableOptions()) {
+            for (CreateTableOptionContext each : ctx.createTableOptions().createTableOption()) {

Review Comment:
   Can you use visit call to reduce code level?



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zihaoAK47 commented on pull request #26332: Support engine parse for mysql

Posted by "zihaoAK47 (via GitHub)" <gi...@apache.org>.
zihaoAK47 commented on PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#issuecomment-1625192805

   @strongduanmu Hi mentor please review thank


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zihaoAK47 commented on a diff in pull request #26332: Support engine parse for mysql

Posted by "zihaoAK47 (via GitHub)" <gi...@apache.org>.
zihaoAK47 commented on code in PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#discussion_r1257275412


##########
parser/sql/dialect/mysql/src/test/java/org/apache/shardingsphere/sql/parser/mysql/visitor/format/MySQLFormatVisitorIT.java:
##########
@@ -76,23 +76,23 @@ public Stream<? extends Arguments> provideArguments(final ExtensionContext exten
                                     + "`runoob_test` NATIONAL CHAR(40),\n"
                                     + "`submission_date` DATE,\n"
                                     + "PRIMARY KEY (`runoob_id`)\n"
-                                    + ")ENGINE=InnoDB DEFAULT CHARSET=utf8;",
+                                    + ")ENGINE=INNODB DEFAULT CHARSET=utf8;",

Review Comment:
   When modifying the vocabulary, this test did not pass, and now the previous modifications have been restored :blush: 



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on a diff in pull request #26332: Support engine parse for mysql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on code in PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#discussion_r1261981825


##########
test/it/parser/src/main/resources/case/ddl/create-table.xml:
##########
@@ -51,8 +78,11 @@
         <column-definition type="varchar" start-index="39" stop-index="56">
             <column name="status" />
         </column-definition>
+        <create-table-option start-index="59" stop-index="95">
+            <engine name="InnoDB" start-index="66" stop-index="71" />
+        </create-table-option>
     </create-table>
-    

Review Comment:
   Please keep same indent with previous line.



##########
parser/sql/statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/dialect/statement/mysql/ddl/MySQLCreateTableStatement.java:
##########
@@ -46,4 +49,12 @@ public final class MySQLCreateTableStatement extends CreateTableStatement implem
     public Optional<SimpleTableSegment> getLikeTable() {
         return Optional.ofNullable(likeTable);
     }
+    
+    /**
+     * Get create table option segment.

Review Comment:
   Please add new line after java doc.



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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zihaoAK47 commented on pull request #26332: Support engine parse for mysql

Posted by "zihaoAK47 (via GitHub)" <gi...@apache.org>.
zihaoAK47 commented on PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#issuecomment-1627319604

   @strongduanmu The modification has been completed please review


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu merged pull request #26332: Support engine parse for mysql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu merged PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on pull request #26332: Support engine parse for mysql

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#issuecomment-1595913415

   Hi @zihaoAK47, thank you for your contribution recently. Can you send your social account to my email? We can talk about more advanced tasks.
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zihaoAK47 commented on pull request #26332: Support engine parse for mysql

Posted by "zihaoAK47 (via GitHub)" <gi...@apache.org>.
zihaoAK47 commented on PR #26332:
URL: https://github.com/apache/shardingsphere/pull/26332#issuecomment-1598536476

   > Hi @zihaoAK47, thank you for your contribution recently. Can you send your social account to my email? We can talk about more advanced tasks.
   
   Error: Unable to find any artifacts for the associated workflow
   
   Hi mentor, I executed the "./mvnw clean install - B - T1C - Dmaven. java doc. skip - Dmaven. jacoco. skip - e" test statement locally and all passed the test. However, I failed to check on Github.
   Can I use WeChat for my social account? I have already sent it to your email and I am looking forward to participating in more advanced tasks. :laughing: 


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org