strongduanmu commented on a change in pull request #16261:
URL: https://github.com/apache/shardingsphere/pull/16261#discussion_r831821050



##########
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/MySQLDDLStatementSQLVisitor.java
##########
@@ -333,6 +333,11 @@ public ASTNode visitAlterList(final AlterListContext ctx) {
                     result.getValue().add(new 
DropConstraintDefinitionSegment(ctx.getStart().getStartIndex(), 
ctx.getStop().getStopIndex(), constraintSegment));
                 } else if (null == alterTableDrop.KEY() && null == 
alterTableDrop.keyOrIndex()) {
                     
result.getValue().add(generateDropColumnDefinitionSegment(alterTableDrop));
+                } else if (null != alterTableDrop.keyOrIndex()) {
+                    IndexSegment indexSegment = (IndexSegment) 
visit(alterTableDrop.indexName());
+                    ConstraintSegment constraintSegment = new 
ConstraintSegment(alterTableDrop.indexName().getStart().getStartIndex(), 
alterTableDrop.indexName().getStop().getStopIndex(),
+                            indexSegment.getIdentifier());
+                    result.getValue().add(new 
DropConstraintDefinitionSegment(ctx.getStart().getStartIndex(), 
ctx.getStop().getStopIndex(), constraintSegment));

Review comment:
       @ICannerxy Why parse drop index segment into 
DropConstraintDefinitionSegment?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to