This is an automated email from the ASF dual-hosted git repository.

menghaoran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 1e5fc2e  fix error of mysql alter table drop column visitor. (#10173)
1e5fc2e is described below

commit 1e5fc2ee662f020ee442aa932259a22e50c7ae1a
Author: huanghao495430759 <34728144+huanghao495430...@users.noreply.github.com>
AuthorDate: Sat Apr 24 03:47:16 2021 -0500

    fix error of mysql alter table drop column visitor. (#10173)
---
 .../mysql/visitor/statement/impl/MySQLDDLStatementSQLVisitor.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/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
 
b/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
index da93251..b6da203 100644
--- 
a/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
+++ 
b/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
@@ -293,7 +293,7 @@ public final class MySQLDDLStatementSQLVisitor extends 
MySQLStatementSQLVisitor
                 if (null == alterTableDrop.KEY() && null == 
alterTableDrop.CHECK() && null == alterTableDrop.CONSTRAINT() && null == 
alterTableDrop.keyOrIndex()) {
                     ColumnSegment column = new 
ColumnSegment(alterTableDrop.columnInternalRef.start.getStartIndex(), 
alterTableDrop.columnInternalRef.stop.getStopIndex(),
                             (IdentifierValue) 
visit(alterTableDrop.columnInternalRef));
-                    result.getValue().add(new 
DropColumnDefinitionSegment(ctx.getStart().getStartIndex(), 
ctx.getStop().getStopIndex(), Collections.singletonList(column)));
+                    result.getValue().add(new 
DropColumnDefinitionSegment(each.getStart().getStartIndex(), 
each.getStop().getStopIndex(), Collections.singletonList(column)));
                 }
             }
         }

Reply via email to