Skip to content

Commit

Permalink
branch-3.0: [fix](variable) variable version not persist in image #46463
Browse files Browse the repository at this point in the history
 (#46497)

Cherry-picked from #46463

Co-authored-by: morrySnow <[email protected]>
  • Loading branch information
github-actions[bot] and morrySnow authored Jan 8, 2025
1 parent e108101 commit 6e0afa4
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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)
Expand Down Expand Up @@ -199,8 +199,7 @@ public static List<String> getPersistentGlobalVarNames() {
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());
}
}
Expand Down

0 comments on commit 6e0afa4

Please sign in to comment.