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

panjuan 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 c80f0ce  Skip actual table into schema metadata (#8350)
c80f0ce is described below

commit c80f0ce3a20f0a9d4a889c8ccca4b7dc683770f4
Author: Liang Zhang <[email protected]>
AuthorDate: Thu Nov 26 12:56:40 2020 +0800

    Skip actual table into schema metadata (#8350)
---
 .../shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
 
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
index 900d56f..6678af8 100644
--- 
a/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
+++ 
b/shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/metadata/schema/builder/SchemaBuilder.java
@@ -23,6 +23,7 @@ import 
org.apache.shardingsphere.infra.metadata.schema.ShardingSphereSchema;
 import 
org.apache.shardingsphere.infra.metadata.schema.builder.loader.SchemaMetaDataLoader;
 import org.apache.shardingsphere.infra.metadata.schema.model.TableMetaData;
 import org.apache.shardingsphere.infra.rule.ShardingSphereRule;
+import org.apache.shardingsphere.infra.rule.type.DataNodeContainedRule;
 import org.apache.shardingsphere.infra.rule.type.TableContainedRule;
 
 import javax.sql.DataSource;
@@ -73,8 +74,8 @@ public final class SchemaBuilder {
     private static Collection<String> getExistedTables(final 
Collection<ShardingSphereRule> rules, final ShardingSphereSchema schema) {
         Collection<String> result = new LinkedHashSet<>();
         for (ShardingSphereRule each : rules) {
-            if (each instanceof TableContainedRule) {
-                result.addAll(((TableContainedRule) each).getTables());
+            if (each instanceof DataNodeContainedRule) {
+                result.addAll(((DataNodeContainedRule) 
each).getAllActualTables());
             }
         }
         result.addAll(schema.getAllTableNames());

Reply via email to