You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/02/02 03:34:48 UTC

[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #9245: fix #9168

jingshanglu commented on a change in pull request #9245:
URL: https://github.com/apache/shardingsphere/pull/9245#discussion_r568299524



##########
File path: shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/AlterShardingRuleBackendHandler.java
##########
@@ -118,8 +118,14 @@ private void checkAddRule(final ShardingRuleConfiguration shardingRuleConfig, fi
     private void alter(final YamlShardingRuleConfiguration yamlShardingRuleConfig, final AlterShardingRuleStatement statement) {
         modifyTableRule(yamlShardingRuleConfig, statement);
         addTableRule(yamlShardingRuleConfig, statement);
-        if (!statement.getBindingTables().isEmpty()) {
-            yamlShardingRuleConfig.setBindingTables(statement.getBindingTables());
+        Collection<String> existBindingTables = yamlShardingRuleConfig.getBindingTables();
+        for (String each : statement.getAddBindingTables()) {
+            if (!existBindingTables.contains(each)) {
+                existBindingTables.add(each);
+            }
+        }
+        for (String each : statement.getDropBindingTables()) {
+            existBindingTables.remove(each);

Review comment:
       @tristaZero 
   
   There's no need to judge.
   




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

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