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 146051b Fixes #12806. (#12808)
146051b is described below
commit 146051b6ee1d7711c5ab4c1463214c4f55d8b9c3
Author: Raigor <[email protected]>
AuthorDate: Wed Sep 29 13:35:27 2021 +0800
Fixes #12806. (#12808)
---
.../apache/shardingsphere/proxy/backend/context/ProxyContext.java | 6 ++----
.../executor/information/SelectInformationSchemataExecutor.java | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
index 4145a38..e6a8c2c 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/context/ProxyContext.java
@@ -29,10 +29,8 @@ import org.apache.shardingsphere.mode.manager.ContextManager;
import
org.apache.shardingsphere.proxy.backend.communication.jdbc.datasource.JDBCBackendDataSource;
import
org.apache.shardingsphere.proxy.backend.exception.NoDatabaseSelectedException;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
-import java.util.List;
import java.util.Optional;
/**
@@ -94,8 +92,8 @@ public final class ProxyContext {
*
* @return all schema names
*/
- public List<String> getAllSchemaNames() {
- return new
ArrayList<>(contextManager.getMetaDataContexts().getAllSchemaNames());
+ public Collection<String> getAllSchemaNames() {
+ return contextManager.getMetaDataContexts().getAllSchemaNames();
}
/**
diff --git
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationSchemataExecutor.java
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationSchemataExecutor.java
index 1200e03..b1c16a3 100644
---
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationSchemataExecutor.java
+++
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/information/SelectInformationSchemataExecutor.java
@@ -63,7 +63,7 @@ public final class SelectInformationSchemataExecutor extends
DefaultSelectInform
@Override
protected List<String> getSchemaNames() {
- List<String> schemaNames =
ProxyContext.getInstance().getAllSchemaNames();
+ Collection<String> schemaNames =
ProxyContext.getInstance().getAllSchemaNames();
SCHEMA_WITHOUT_DATA_SOURCE.addAll(schemaNames.stream().filter(each ->
!AbstractSelectInformationExecutor.hasDatasource(each)).collect(Collectors.toSet()));
List<String> result =
schemaNames.stream().filter(AbstractSelectInformationExecutor::hasDatasource).collect(Collectors.toList());
if (!SCHEMA_WITHOUT_DATA_SOURCE.isEmpty()) {