flycash commented on a change in pull request #13398:
URL: https://github.com/apache/shardingsphere/pull/13398#discussion_r742577582



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/impl/MySQLDALStatementSQLVisitor.java
##########
@@ -238,7 +243,56 @@ public ASTNode visitShowWarnings(final ShowWarningsContext 
ctx) {
     
     @Override
     public ASTNode visitResetStatement(final ResetStatementContext ctx) {
-        return new MySQLResetStatement();
+        MySQLStatementParser.ResetPersistContext persistContext = 
ctx.resetPersist();
+        if (null != persistContext) {
+            return visit(persistContext);
+        }
+        MySQLResetStatement result = new MySQLResetStatement();
+        for (MySQLStatementParser.ResetOptionContext optCtx : 
ctx.resetOption()) {
+            ResetOptionSegment opt = (ResetOptionSegment) (visit(optCtx));
+            result.getOptions().add(opt);
+        }
+        return result;
+    }
+
+    @Override
+    public ASTNode visitResetPersist(final 
MySQLStatementParser.ResetPersistContext ctx) {
+        MySQLResetPersistStatement result = new MySQLResetPersistStatement();
+        if (ctx.existClause() != null) {
+            result.setContainsExistClause(true);
+        }
+        if (ctx.identifier() != null) {
+            result.setIdentifier(new 
IdentifierValue(ctx.identifier().getText()));
+        }
+        return result;
+    }
+
+    @Override
+    public ASTNode visitResetOption(final 
MySQLStatementParser.ResetOptionContext ctx) {
+        ResetOptionSegment result = new ResetOptionSegment();
+        result.setStartIndex(ctx.start.getStartIndex());
+        result.setStopIndex(ctx.stop.getStopIndex());
+        if (ctx.MASTER() != null) {
+            result.setTarget(ctx.MASTER().getText());

Review comment:
       I use second solution




-- 
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-unsubscr...@shardingsphere.apache.org

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


Reply via email to