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

panjuan 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 d38580d  fix : Adjust the display name of readwrite splitting (#11903)
d38580d is described below

commit d38580dd3528f1f42ca69fc05553a99ec76abe0f
Author: lanchengx <[email protected]>
AuthorDate: Thu Aug 19 22:52:33 2021 -0500

    fix : Adjust the display name of readwrite splitting (#11903)
---
 .../executor/ShowReadwriteSplittingHintStatusExecutor.java    | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/hint/executor/ShowReadwriteSplittingHintStatusExecutor.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/hint/executor/ShowReadwriteSplittingHintStatusExecutor.java
index 73ebbb7..cfdb7d3 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/hint/executor/ShowReadwriteSplittingHintStatusExecutor.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/ral/common/hint/executor/ShowReadwriteSplittingHintStatusExecutor.java
@@ -21,6 +21,7 @@ import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.infra.hint.HintManager;
 import org.apache.shardingsphere.infra.merge.result.MergedResult;
 import 
org.apache.shardingsphere.proxy.backend.response.header.query.impl.QueryHeader;
+import 
org.apache.shardingsphere.proxy.backend.text.distsql.ral.common.hint.HintSourceType;
 import 
org.apache.shardingsphere.readwritesplitting.distsql.parser.statement.hint.ShowReadwriteSplittingHintStatusStatement;
 import 
org.apache.shardingsphere.sharding.merge.dal.common.MultipleLocalDataMergedResult;
 
@@ -38,19 +39,19 @@ public final class ShowReadwriteSplittingHintStatusExecutor 
extends AbstractHint
     @Override
     protected List<QueryHeader> createQueryHeaders() {
         List<QueryHeader> result = new ArrayList<>(2);
-        result.add(new QueryHeader("", "", "write_only", "", Types.CHAR, 
"CHAR", 5, 0, false, false, false, false));
+        result.add(new QueryHeader("", "", "source", "", Types.CHAR, "CHAR", 
5, 0, false, false, false, false));
         return result;
     }
     
     @Override
     protected MergedResult createMergedResult() {
-        List<Object> row = createRow(HintManager.isWriteRouteOnly());
+        List<Object> row = createRow(HintManager.isWriteRouteOnly() ? 
HintSourceType.WRITE.getValue() : HintSourceType.AUTO.getValue());
         return new 
MultipleLocalDataMergedResult(Collections.singletonList(row));
     }
     
-    private List<Object> createRow(final boolean primaryOnly) {
-        List<Object> result = new ArrayList<>(2);
-        result.add(String.valueOf(primaryOnly).toLowerCase());
+    private List<Object> createRow(final String source) {
+        List<Object> result = new ArrayList<>(1);
+        result.add(source);
         return result;
     }
 }

Reply via email to