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

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 4f3b9bb0eb1 [fix](variable) variable version not persist in image 
(#46463)
4f3b9bb0eb1 is described below

commit 4f3b9bb0eb12a666c39c8e4e55d3b3e7703ff2fc
Author: morrySnow <zhangwen...@selectdb.com>
AuthorDate: Tue Jan 7 10:28:35 2025 +0800

    [fix](variable) variable version not persist in image (#46463)
    
    ### What problem does this PR solve?
    
    Related PR: #41607 #45648
    
    Problem Summary:
    org.apache.doris.qe.GlobalVariable#getPersistentGlobalVarNames should
    use bit and to check whether variable is Global
---
 fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
index e3639596ed3..ed4f1757daf 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
@@ -92,7 +92,7 @@ public final class GlobalVariable {
     // 0: table names are stored as specified and comparisons are case 
sensitive.
     // 1: table names are stored in lowercase on disk and comparisons are not 
case sensitive.
     // 2: table names are stored as given but compared in lowercase.
-    @VariableMgr.VarAttr(name = LOWER_CASE_TABLE_NAMES, flag = 
VariableMgr.READ_ONLY)
+    @VariableMgr.VarAttr(name = LOWER_CASE_TABLE_NAMES, flag = 
VariableMgr.READ_ONLY | VariableMgr.GLOBAL)
     public static int lowerCaseTableNames = 0;
 
     @VariableMgr.VarAttr(name = LICENSE, flag = VariableMgr.READ_ONLY)
@@ -200,8 +200,7 @@ public final class GlobalVariable {
         List<String> varNames = Lists.newArrayList();
         for (Field field : GlobalVariable.class.getDeclaredFields()) {
             VariableMgr.VarAttr attr = 
field.getAnnotation(VariableMgr.VarAttr.class);
-            // Since the flag of lower_case_table_names is READ_ONLY, it is 
handled separately here.
-            if (attr != null && (attr.flag() == VariableMgr.GLOBAL || 
attr.name().equals(LOWER_CASE_TABLE_NAMES))) {
+            if (attr != null && (attr.flag() & VariableMgr.GLOBAL) != 0) {
                 varNames.add(attr.name());
             }
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to