This is an automated email from the ASF dual-hosted git repository.
terrymanu 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 2e4bc504ed7 Refine MCP database dialect system schema fallback (#39049)
2e4bc504ed7 is described below
commit 2e4bc504ed792cee62ae56fbb511c11c5bbbf470
Author: Liang Zhang <[email protected]>
AuthorDate: Wed Jul 8 15:00:13 2026 +0800
Refine MCP database dialect system schema fallback (#39049)
---
.../support/database/capability/MCPDatabaseDialect.java | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git
a/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/database/capability/MCPDatabaseDialect.java
b/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/database/capability/MCPDatabaseDialect.java
index 3357f634b33..01d33f9c59a 100644
---
a/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/database/capability/MCPDatabaseDialect.java
+++
b/mcp/support/src/main/java/org/apache/shardingsphere/mcp/support/database/capability/MCPDatabaseDialect.java
@@ -183,25 +183,13 @@ public final class MCPDatabaseDialect {
private Collection<String> getSystemSchemas() {
Collection<String> optionSystemSchemas =
option.map(MCPDatabaseCapabilityOption::getSystemSchemas).orElseGet(List::of);
- return findDialectSystemSchemas().filter(each ->
optionSystemSchemas.isEmpty() || containsSameSystemSchemas(each,
optionSystemSchemas)).orElse(optionSystemSchemas);
+ return optionSystemSchemas.isEmpty() ?
findDialectSystemSchemas().orElse(optionSystemSchemas) : optionSystemSchemas;
}
private Optional<Collection<String>> findDialectSystemSchemas() {
return
systemDatabase.map(SystemDatabase::getSystemSchemas).filter(each ->
!each.isEmpty());
}
- private static boolean containsSameSystemSchemas(final Collection<String>
systemSchemas, final Collection<String> expectedSystemSchemas) {
- if (systemSchemas.size() != expectedSystemSchemas.size()) {
- return false;
- }
- for (String each : systemSchemas) {
- if (!containsSystemSchema(expectedSystemSchemas, each)) {
- return false;
- }
- }
- return true;
- }
-
private static boolean containsSystemSchema(final Collection<String>
systemSchemas, final String schemaName) {
for (String each : systemSchemas) {
if (schemaName.equalsIgnoreCase(each)) {