This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 8dc5b6c0b8f Fix the case-sensitive issue when partially updating
encryption rules. (#31277)
8dc5b6c0b8f is described below
commit 8dc5b6c0b8f9f0413350a2332adc697c638609b2
Author: Cong Hu <[email protected]>
AuthorDate: Sat May 18 21:24:15 2024 +0800
Fix the case-sensitive issue when partially updating encryption rules.
(#31277)
---
.../main/java/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 75e1f88d253..19992b809fe 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 final class EncryptRule implements DatabaseRule,
PartialRuleUpdateSupport
@Override
public boolean partialUpdate(final EncryptRuleConfiguration
toBeUpdatedRuleConfig) {
- Collection<String> toBeAddedTableNames =
toBeUpdatedRuleConfig.getTables().stream().map(EncryptTableRuleConfiguration::getName).collect(Collectors.toList());
- toBeAddedTableNames.removeAll(tables.keySet());
+ Collection<String> 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())));