You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by me...@apache.org on 2021/02/05 09:29:57 UTC
[shardingsphere] branch master updated: Fixes #9240 (#9351)
This is an automated email from the ASF dual-hosted git repository.
menghaoran 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 810f025 Fixes #9240 (#9351)
810f025 is described below
commit 810f025af213e018cbfae5ce55fed7a234b8858a
Author: Liang Zhang <te...@163.com>
AuthorDate: Fri Feb 5 17:29:17 2021 +0800
Fixes #9240 (#9351)
* Fix #9240
* Fix test case
---
.../backend/text/data/impl/UnicastDatabaseBackendHandler.java | 7 ++-----
.../src/test/resources/env/engine-env.properties | 3 +--
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/data/impl/UnicastDatabaseBackendHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/data/impl/UnicastDatabaseBackendHandler.java
index 304cbcc..57ec70f 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/data/impl/UnicastDatabaseBackendHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/data/impl/UnicastDatabaseBackendHandler.java
@@ -49,11 +49,8 @@ public final class UnicastDatabaseBackendHandler implements DatabaseBackendHandl
@Override
public ResponseHeader execute() throws SQLException {
- if (null == backendConnection.getSchemaName()) {
- // TODO should remove set default ShardingSphere schema after parser can recognize all DAL broadcast SQL.
- backendConnection.setCurrentSchema(getFirstSchemaName());
- }
- if (!ProxyContext.getInstance().getMetaData(backendConnection.getSchemaName()).isComplete()) {
+ String schemaName = null == backendConnection.getSchemaName() ? getFirstSchemaName() : backendConnection.getSchemaName();
+ if (!ProxyContext.getInstance().getMetaData(schemaName).isComplete()) {
throw new RuleNotExistsException();
}
databaseCommunicationEngine = databaseCommunicationEngineFactory.newTextProtocolInstance(sqlStatement, sql, backendConnection);
diff --git a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/resources/env/engine-env.properties b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/resources/env/engine-env.properties
index 3ace88e..90a38f7 100644
--- a/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/resources/env/engine-env.properties
+++ b/shardingsphere-test/shardingsphere-integration-agent-test/shardingsphere-integration-agent-test-plugins/shardingsphere-integration-agent-test-metrics/src/test/resources/env/engine-env.properties
@@ -18,7 +18,7 @@
it.env.type=${it.env}
it.env.value=metrics
-proxy.url=jdbc:mysql://127.0.0.1:43070?serverTimezone=UTC&useSSL=false&useLocalSessionState=true&characterEncoding=utf-8
+proxy.url=jdbc:mysql://127.0.0.1:43070/agent-metrics-db?serverTimezone=UTC&useSSL=false&useLocalSessionState=true&characterEncoding=utf-8
proxy.username=root
proxy.password=root
proxy.retry=30
@@ -26,4 +26,3 @@ proxy.waitMs=1000
prometheus.waitMs=60000
prometheus.url=http://127.0.0.1:19090/api/v1/metadata?metric=
-