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 2022/01/30 06:11:58 UTC

[GitHub] [shardingsphere] tuichenchuxin commented on a change in pull request #15207: Fixed Refresh SingleTableRule tables.

tuichenchuxin commented on a change in pull request #15207:
URL: https://github.com/apache/shardingsphere/pull/15207#discussion_r795133338



##########
File path: shardingsphere-mode/shardingsphere-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/ContextManager.java
##########
@@ -248,19 +250,27 @@ public void alterSchema(final String schemaName, final ShardingSphereSchema sche
      * @param deletedTable deleted table
      */
     public void alterSchema(final String schemaName, final TableMetaData changedTableMetaData, final String deletedTable) {
+        ShardingSphereMetaData metaData = metaDataContexts.getMetaData(schemaName);
+        if (!containsInDataNodeContainedRule(changedTableMetaData.getName(), metaData)) {
+            metaData.getRuleMetaData().findRules(MutableDataNodeRule.class).forEach(each -> each.put(changedTableMetaData.getName(), each.getDataSourceNames().iterator().next()));

Review comment:
       This datasource can't be iterator.next().
   It need to be the actual one.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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