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

menghaoranss 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 12bee2019f5 Use protocol schema resolver in SQL integration tests 
(#39712)
12bee2019f5 is described below

commit 12bee2019f5b90cf8e9bc8da13ee350470bd80ed
Author: Haoran Meng <[email protected]>
AuthorDate: Thu Sep 3 19:16:11 2026 +0800

    Use protocol schema resolver in SQL integration tests (#39712)
---
 .../test/it/sql/binder/HavingCorrelatedSubqueryBinderIT.java          | 4 ++--
 .../org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java     | 4 ++--
 .../apache/shardingsphere/test/it/rewriter/engine/SQLRewriterIT.java  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/HavingCorrelatedSubqueryBinderIT.java
 
b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/HavingCorrelatedSubqueryBinderIT.java
index 2d7651820c0..1e532e14cc0 100644
--- 
a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/HavingCorrelatedSubqueryBinderIT.java
+++ 
b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/HavingCorrelatedSubqueryBinderIT.java
@@ -17,8 +17,8 @@
 
 package org.apache.shardingsphere.test.it.sql.binder;
 
+import 
org.apache.shardingsphere.database.connector.core.metadata.identifier.DefaultSchemaNameResolver;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
-import 
org.apache.shardingsphere.database.connector.core.type.DatabaseTypeRegistry;
 import 
org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
 import org.apache.shardingsphere.infra.binder.engine.SQLBindEngine;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
@@ -95,7 +95,7 @@ class HavingCorrelatedSubqueryBinderIT {
     
     private Collection<ShardingSphereSchema> mockSchemas(final DatabaseType 
databaseType) {
         Collection<ShardingSphereSchema> result = new LinkedList<>();
-        String defaultSchemaName = new 
DatabaseTypeRegistry(databaseType).getDefaultSchemaName("foo_db");
+        String defaultSchemaName = 
DefaultSchemaNameResolver.resolveProtocol(databaseType, "foo_db");
         result.add(new ShardingSphereSchema(defaultSchemaName, databaseType, 
mockTables(), Collections.emptyList()));
         return result;
     }
diff --git 
a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
 
b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
index 50c81c57a9a..53e2c08c444 100644
--- 
a/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
+++ 
b/test/it/binder/src/test/java/org/apache/shardingsphere/test/it/sql/binder/SQLBinderIT.java
@@ -18,8 +18,8 @@
 package org.apache.shardingsphere.test.it.sql.binder;
 
 import com.google.common.base.Preconditions;
+import 
org.apache.shardingsphere.database.connector.core.metadata.identifier.DefaultSchemaNameResolver;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
-import 
org.apache.shardingsphere.database.connector.core.type.DatabaseTypeRegistry;
 import org.apache.shardingsphere.infra.binder.engine.SQLBindEngine;
 import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
 import 
org.apache.shardingsphere.infra.config.props.MetadataIdentifierCaseSensitivity;
@@ -102,7 +102,7 @@ public abstract class SQLBinderIT {
     
     private Collection<ShardingSphereSchema> mockSchemas(final DatabaseType 
databaseType, final String databaseName) {
         Collection<ShardingSphereSchema> result = new LinkedList<>();
-        String defaultSchemaName = new 
DatabaseTypeRegistry(databaseType).getDefaultSchemaName(databaseName);
+        String defaultSchemaName = 
DefaultSchemaNameResolver.resolveProtocol(databaseType, databaseName);
         Collection<ShardingSphereTable> tables = 
"foo_db_1".equalsIgnoreCase(databaseName) ? mockFooDB1Tables() : 
mockFooDB2Tables();
         result.add(new ShardingSphereSchema(defaultSchemaName, databaseType, 
tables, Collections.emptyList()));
         return result;
diff --git 
a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewriter/engine/SQLRewriterIT.java
 
b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewriter/engine/SQLRewriterIT.java
index 13d8a08ca1a..30297d5cb3f 100644
--- 
a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewriter/engine/SQLRewriterIT.java
+++ 
b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewriter/engine/SQLRewriterIT.java
@@ -21,9 +21,9 @@ import com.google.common.base.Preconditions;
 import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.database.connector.core.DefaultDatabase;
 import 
org.apache.shardingsphere.database.connector.core.jdbcurl.parser.ConnectionProperties;
+import 
org.apache.shardingsphere.database.connector.core.metadata.identifier.DefaultSchemaNameResolver;
 import 
org.apache.shardingsphere.database.connector.core.spi.DatabaseTypedSPILoader;
 import org.apache.shardingsphere.database.connector.core.type.DatabaseType;
-import 
org.apache.shardingsphere.database.connector.core.type.DatabaseTypeRegistry;
 import org.apache.shardingsphere.infra.binder.context.aware.ParameterAware;
 import 
org.apache.shardingsphere.infra.binder.context.statement.SQLStatementContext;
 import 
org.apache.shardingsphere.infra.binder.context.statement.type.ddl.CursorHeldSQLStatementContext;
@@ -184,7 +184,7 @@ public abstract class SQLRewriterIT {
                 new 
YamlDataSourceConfigurationSwapper().swapToDataSources(rootConfig.getDataSources()),
 new 
YamlRuleConfigurationSwapperEngine().swapToRuleConfigurations(rootConfig.getRules()));
         ResourceMetaData resourceMetaData = new 
ResourceMetaData(Collections.emptyMap(), createStorageUnits(databaseConfig, 
databaseType));
         String databaseName = null == rootConfig.getDatabaseName() ? 
DefaultDatabase.LOGIC_NAME : rootConfig.getDatabaseName();
-        String schemaName = new 
DatabaseTypeRegistry(databaseType).getDefaultSchemaName(databaseName);
+        String schemaName = 
DefaultSchemaNameResolver.resolveProtocol(databaseType, databaseName);
         Collection<ShardingSphereRule> rules = 
createDatabaseRules(databaseConfig, schemaName, sqlStatement, databaseType);
         ConfigurationProperties props = 
createConfigurationProperties(rootConfig);
         RuleMetaData ruleMetaData = new RuleMetaData(rules);

Reply via email to