This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new b4e8d08c7f6 Refactor SchemaMetaDataUtils (#34016)
b4e8d08c7f6 is described below

commit b4e8d08c7f6cf6e2e1a368dd06fb4e2653267bba
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Dec 12 11:11:26 2024 +0800

    Refactor SchemaMetaDataUtils (#34016)
---
 .../infra/metadata/database/schema/util/SchemaMetaDataUtils.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
index 81e460adb32..cbc2719114e 100644
--- 
a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
+++ 
b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
@@ -137,7 +137,7 @@ public final class SchemaMetaDataUtils {
     private static void addAllActualTableDataNode(final 
GenericSchemaBuilderMaterial material,
                                                   final Map<String, 
Collection<String>> dataSourceTableGroups, final DataNodes dataNodes, final 
String table) {
         Collection<DataNode> tableDataNodes = dataNodes.getDataNodes(table);
-        if (tableDataNodes.isEmpty()) {
+        if (tableDataNodes.isEmpty() && !material.getStorageUnits().isEmpty()) 
{
             
addDataSourceTableGroups(material.getStorageUnits().keySet().iterator().next(), 
table, dataSourceTableGroups);
         } else {
             tableDataNodes.forEach(each -> 
addDataSourceTableGroups(each.getDataSourceName(), each.getTableName(), 
dataSourceTableGroups));

Reply via email to