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 84f9266c81c Fix set variable statement cleaning global properties in 
registry center (#19804)
84f9266c81c is described below

commit 84f9266c81cf0b088f94bbfef07219675db10237
Author: Hongsheng Zhong <[email protected]>
AuthorDate: Wed Aug 3 21:36:26 2022 +0800

    Fix set variable statement cleaning global properties in registry center 
(#19804)
---
 .../backend/handler/distsql/ral/updatable/SetVariableHandler.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetVariableHandler.java
 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetVariableHandler.java
index 1e9211ab744..8c05a47b689 100644
--- 
a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetVariableHandler.java
+++ 
b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/SetVariableHandler.java
@@ -64,10 +64,11 @@ public final class SetVariableHandler extends 
UpdatableRALBackendHandler<SetVari
     private void handleConfigurationProperty(final ConfigurationPropertyKey 
propertyKey, final String value) {
         ContextManager contextManager = 
ProxyContext.getInstance().getContextManager();
         MetaDataContexts metaDataContexts = 
contextManager.getMetaDataContexts();
-        MetaDataPersistService persistService = 
metaDataContexts.getPersistService();
-        Properties props = new 
Properties(metaDataContexts.getMetaData().getProps().getProps());
+        Properties props = new Properties();
+        props.putAll(metaDataContexts.getMetaData().getProps().getProps());
         props.put(propertyKey.getKey(), getValue(propertyKey, value));
         contextManager.alterProperties(props);
+        MetaDataPersistService persistService = 
metaDataContexts.getPersistService();
         if (null != persistService.getPropsService()) {
             persistService.getPropsService().persist(props, true);
         }

Reply via email to