diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptAlterTableTokenGenerator.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptAlterTableTokenGenerator.java index 6fa11e1e4ecc2..22312b69d9c9a 100644 --- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptAlterTableTokenGenerator.java +++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/EncryptAlterTableTokenGenerator.java @@ -121,7 +121,10 @@ private Optional getAddColumnPositionToken(final EncryptTable encryptT if (columnPositionSegment.isPresent()) { String columnName = columnPositionSegment.get().getColumnName().getIdentifier().getValue(); if (encryptTable.isEncryptColumn(columnName)) { - return Optional.of(getPositionColumnToken(encryptTable.getEncryptColumn(columnName), segment.getColumnPosition().get())); + EncryptColumn encryptColumn = encryptTable.getEncryptColumn(columnName); + ShardingSpherePreconditions.checkState(encryptColumn.getName().equals(encryptColumn.getCipher().getName()), + () -> new UnsupportedOperationException(String.format("Column %s is already exists", columnName))); + return Optional.of(getPositionColumnToken(encryptColumn, segment.getColumnPosition().get())); } } return Optional.empty();