You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/04/12 03:28:21 UTC
[shardingsphere] branch master updated: issue_25067 (#25125)
This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 2c1bdd26cf3 issue_25067 (#25125)
2c1bdd26cf3 is described below
commit 2c1bdd26cf3d163ef5fdc2615590325bc67ec867
Author: liguoping <xd...@163.com>
AuthorDate: Wed Apr 12 11:28:14 2023 +0800
issue_25067 (#25125)
---
.../infra/metadata/database/schema/util/SchemaMetaDataUtils.java | 3 +++
1 file changed, 3 insertions(+)
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 91972e99a67..233d2406cd4 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
@@ -96,6 +96,9 @@ public final class SchemaMetaDataUtils {
private static void addOneActualTableDataNode(final GenericSchemaBuilderMaterial material,
final Map<String, Collection<String>> dataSourceTableGroups, final DataNodes dataNodes, final String table) {
Optional<DataNode> dataNode = dataNodes.getDataNodes(table).stream().filter(each -> isSameDataSourceNameSchemaName(material, each)).findFirst();
+ if (!dataNode.isPresent() && !material.getDataSourceMap().keySet().iterator().hasNext()) {
+ return;
+ }
String dataSourceName = dataNode.map(DataNode::getDataSourceName).orElseGet(() -> material.getDataSourceMap().keySet().iterator().next());
String tableName = dataNode.map(DataNode::getTableName).orElse(table);
addDataSourceTableGroups(dataSourceName, tableName, dataSourceTableGroups);