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/06/11 11:41:46 UTC

[shardingsphere] branch master updated: fix UnsupportedOperationException when execute ConcurrentHashMap.keySet().addAll() (#10767)

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 e3f6ac5  fix UnsupportedOperationException when execute ConcurrentHashMap.keySet().addAll() (#10767)
e3f6ac5 is described below

commit e3f6ac5290403a140922cc0920803620525f5dec
Author: Zhengqiang Duan <st...@gmail.com>
AuthorDate: Fri Jun 11 19:41:04 2021 +0800

    fix UnsupportedOperationException when execute ConcurrentHashMap.keySet().addAll() (#10767)
---
 .../text/distsql/rdl/impl/CreateShardingTableRuleBackendHandler.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateShardingTableRuleBackendHandler.java b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateShardingTableRuleBackendHandler.java
index 377e684..a8b3736 100644
--- a/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateShardingTableRuleBackendHandler.java
+++ b/shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/text/distsql/rdl/impl/CreateShardingTableRuleBackendHandler.java
@@ -17,6 +17,7 @@
 
 package org.apache.shardingsphere.proxy.backend.text.distsql.rdl.impl;
 
+import com.google.common.collect.Sets;
 import org.apache.shardingsphere.distsql.parser.segment.TableRuleSegment;
 import org.apache.shardingsphere.distsql.parser.statement.rdl.create.impl.CreateShardingTableRuleStatement;
 import org.apache.shardingsphere.infra.spi.ShardingSphereServiceLoader;
@@ -103,7 +104,7 @@ public final class CreateShardingTableRuleBackendHandler extends RDLBackendHandl
     }
     
     private Collection<String> getAllTables(final String schemaName) {
-        Collection<String> result = ProxyContext.getInstance().getMetaData(schemaName).getSchema().getAllTableNames();
+        Collection<String> result = Sets.newHashSet(ProxyContext.getInstance().getMetaData(schemaName).getSchema().getAllTableNames());
         if (getShardingRuleConfiguration(schemaName).isPresent()) {
             result.addAll(getShardingTables(getShardingRuleConfiguration(schemaName).get()));
         }