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

jianglongtao 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 b0a87f38e75 EXPORT DATABASE CONFIGURATION optimization (#27926)
b0a87f38e75 is described below

commit b0a87f38e752f9ca6e36f254df51d3a4aab755fd
Author: yx9o <[email protected]>
AuthorDate: Sat Aug 5 00:26:50 2023 +0800

    EXPORT DATABASE CONFIGURATION optimization (#27926)
---
 .../java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
index 4ae91535d0f..88d46568ebd 100644
--- 
a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
+++ 
b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/util/ExportUtils.java
@@ -105,7 +105,7 @@ public final class ExportUtils {
     
     @SuppressWarnings({"rawtypes", "unchecked"})
     private static void appendRuleConfigurations(final 
Collection<RuleConfiguration> ruleConfigs, final StringBuilder stringBuilder) {
-        if (ruleConfigs.isEmpty()) {
+        if (ruleConfigs.isEmpty() || ruleConfigs.stream().allMatch(each -> 
((DatabaseRuleConfiguration) each).isEmpty())) {
             return;
         }
         stringBuilder.append("rules:").append(System.lineSeparator());

Reply via email to