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/04/27 13:05:11 UTC

[GitHub] [shardingsphere] menghaoranss commented on a change in pull request #10206: Load metadata for tables without table rule

menghaoranss commented on a change in pull request #10206:
URL: https://github.com/apache/shardingsphere/pull/10206#discussion_r621188235



##########
File path: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/refresher/type/CreateTableStatementSchemaRefresher.java
##########
@@ -44,7 +45,7 @@ public void refresh(final ShardingSphereSchema schema, final Collection<String>
         if (containsInTableContainedRule(tableName, materials)) {
             tableMetaData = TableMetaDataBuilder.build(tableName, materials).orElse(new TableMetaData());
         } else {
-            tableMetaData = new TableMetaData();
+            tableMetaData = TableMetaDataLoader.load(materials.getDataSourceMap().get(routeDataSourceNames.iterator().next()), tableName, materials.getDatabaseType()).orElse(new TableMetaData());

Review comment:
       The tables in DDL and not in table rule,  there should be only one route data source,may be we should check `routeDataSourceNames.size() !=0` ?
   
   




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