Skip to content

Commit 4f3b9bb

Browse files
authored
[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
1 parent ae36af9 commit 4f3b9bb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public final class GlobalVariable {
9292
// 0: table names are stored as specified and comparisons are case sensitive.
9393
// 1: table names are stored in lowercase on disk and comparisons are not case sensitive.
9494
// 2: table names are stored as given but compared in lowercase.
95-
@VariableMgr.VarAttr(name = LOWER_CASE_TABLE_NAMES, flag = VariableMgr.READ_ONLY)
95+
@VariableMgr.VarAttr(name = LOWER_CASE_TABLE_NAMES, flag = VariableMgr.READ_ONLY | VariableMgr.GLOBAL)
9696
public static int lowerCaseTableNames = 0;
9797

9898
@VariableMgr.VarAttr(name = LICENSE, flag = VariableMgr.READ_ONLY)
@@ -200,8 +200,7 @@ public static List<String> getPersistentGlobalVarNames() {
200200
List<String> varNames = Lists.newArrayList();
201201
for (Field field : GlobalVariable.class.getDeclaredFields()) {
202202
VariableMgr.VarAttr attr = field.getAnnotation(VariableMgr.VarAttr.class);
203-
// Since the flag of lower_case_table_names is READ_ONLY, it is handled separately here.
204-
if (attr != null && (attr.flag() == VariableMgr.GLOBAL || attr.name().equals(LOWER_CASE_TABLE_NAMES))) {
203+
if (attr != null && (attr.flag() & VariableMgr.GLOBAL) != 0) {
205204
varNames.add(attr.name());
206205
}
207206
}

0 commit comments

Comments
 (0)