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 ec920877b15 Refactor DatabaseConnector (#32438)
ec920877b15 is described below
commit ec920877b15a1fdb976ae49b1415bd900357bc92
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Aug 9 14:39:07 2024 +0800
Refactor DatabaseConnector (#32438)
---
.../shardingsphere/proxy/backend/connector/DatabaseConnector.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java
index 73b48071768..ad377f30f56 100644
---
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java
+++
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/DatabaseConnector.java
@@ -133,9 +133,7 @@ public final class DatabaseConnector implements
DatabaseBackendHandler {
boolean isSystemSchema =
SystemSchemaUtils.containsSystemSchema(sqlStatementContext.getDatabaseType(),
sqlStatementContext instanceof TableAvailable ?
((TableAvailable) sqlStatementContext).getTablesContext().getSchemaNames() :
Collections.emptyList(), database);
ShardingSpherePreconditions.checkState(isSystemSchema ||
database.containsDataSource(), () -> new
EmptyStorageUnitException(connectionSession.getUsedDatabaseName()));
- if (!isSystemSchema && !database.isComplete()) {
- throw new
EmptyRuleException(connectionSession.getUsedDatabaseName());
- }
+ ShardingSpherePreconditions.checkState(isSystemSchema ||
database.isComplete(), () -> new
EmptyRuleException(connectionSession.getUsedDatabaseName()));
}
/**