tristaZero commented on a change in pull request #4123: Add MySQL DDLStatement 
antlr visitor
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4123#discussion_r373757511
 
 

 ##########
 File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/MySQLVisitor.java
 ##########
 @@ -190,6 +227,135 @@ public ASTNode visitCreateUser(final CreateUserContext 
ctx) {
     }
 
     // DDLStatement.g4
+    @Override
+    public ASTNode visitCreateTable(final CreateTableContext ctx) {
+        CreateTableStatement result = new CreateTableStatement();
+        TableSegment table = (TableSegment) visit(ctx.tableName());
+        result.setTable(table);
+        result.getAllSQLSegments().add(table);
+        CreateDefinitionClause_Context createDefinitionClause = 
ctx.createDefinitionClause_();
+        if (null != createDefinitionClause) {
 
 Review comment:
   IMO, it is better to put it to visitCreateDefinitionClause(). Parent visior 
has no reposibility to visit its child visitor, and just gets the result 
returned by its child.

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


With regards,
Apache Git Services

Reply via email to