From 8dc5b6c0b8f9f0413350a2332adc697c638609b2 Mon Sep 17 00:00:00 2001 From: Cong Hu Date: Sat, 18 May 2024 21:24:15 +0800 Subject: [PATCH] Fix the case-sensitive issue when partially updating encryption rules. (#31277) --- .../org/apache/shardingsphere/encrypt/rule/EncryptRule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java index 75e1f88d2531d..19992b809fea1 100644 --- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java +++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java @@ -135,8 +135,8 @@ public void updateConfiguration(final EncryptRuleConfiguration toBeUpdatedRuleCo @Override public boolean partialUpdate(final EncryptRuleConfiguration toBeUpdatedRuleConfig) { - Collection toBeAddedTableNames = toBeUpdatedRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).collect(Collectors.toList()); - toBeAddedTableNames.removeAll(tables.keySet()); + Collection toBeAddedTableNames = toBeUpdatedRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).filter(each -> !tables.containsKey(each.toLowerCase())) + .collect(Collectors.toList()); if (!toBeAddedTableNames.isEmpty()) { toBeAddedTableNames.forEach(each -> addTableRule(each, toBeUpdatedRuleConfig)); attributes.set(new RuleAttributes(new EncryptTableMapperRuleAttribute(tables.keySet())));