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



##########
File path: 
shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptAlterTableTokenGenerator.java
##########
@@ -50,10 +53,43 @@ protected boolean isGenerateSQLTokenForEncrypt(final 
SQLStatementContext sqlStat
         String tableName = 
alterTableStatementContext.getSqlStatement().getTable().getTableName().getIdentifier().getValue();
         Collection<SQLToken> result = new 
LinkedList<>(getAddColumnTokens(tableName, 
alterTableStatementContext.getSqlStatement().getAddColumnDefinitions()));
         result.addAll(getModifyColumnTokens(tableName, 
alterTableStatementContext.getSqlStatement().getModifyColumnDefinitions()));
-        result.addAll(getDropColumnTokens(tableName, 
alterTableStatementContext.getSqlStatement().getDropColumnDefinitions()));
+        Collection<SQLToken> dropCollection = getDropColumnTokens(tableName, 
alterTableStatementContext.getSqlStatement().getDropColumnDefinitions());
+        String databaseName = 
alterTableStatementContext.getDatabaseType().getName();
+        if ("SQLServer".equals(databaseName)) {
+            result.addAll(mergeDropColumnStatement(dropCollection, "", ""));
+        } else if ("Oracle".equals(databaseName)) {
+            result.addAll(mergeDropColumnStatement(dropCollection, "(", ")"));
+        } else {
+            result.addAll(dropCollection);
+        }
         return result;
     }
     
+    private Collection<SQLToken> mergeDropColumnStatement(final 
Collection<SQLToken> dropCollection, final String leftJoiner, final String 
rightJoiner) {
+        Collection<SQLToken> filteredDropCollection = new LinkedList<>();

Review comment:
       @arthasking123 `result` is better.




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