Skip to content

Commit 56cce28

Browse files
committed
Bug#31968366 SET PERSIST FOR COMPONENTS GENERATES A FLOOD OF WARNINGS
Post push fix: fixed persisted_sysvars_with_aliases test failure RB#26373
1 parent 3492573 commit 56cce28

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sql/persisted_variable.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,8 @@ void Persisted_variables_cache::load_aliases() {
10531053
// in alphabetic order. This makes test cases more deterministic.
10541054
std::map<std::string, std::string> deprecated;
10551055

1056-
std::unordered_set<std::string> var_set;
1057-
for (auto &var : m_persist_variables) var_set.insert(var.key);
1056+
std::unordered_set<st_persist_var, st_persist_var_hash> var_set;
1057+
for (auto &var : m_persist_variables) var_set.insert(var);
10581058

10591059
/*
10601060
If variable has an alias, and it does not exist in the container,
@@ -1083,10 +1083,15 @@ void Persisted_variables_cache::load_aliases() {
10831083
}
10841084
};
10851085
lock();
1086-
for (auto iter : m_persist_variables) {
1086+
1087+
for (auto iter : var_set) {
10871088
insert_alias(
10881089
[&](const char *name) -> bool {
1089-
return var_set.find(name) != var_set.end();
1090+
auto it = std::find_if(var_set.begin(), var_set.end(),
1091+
[name](st_persist_var const &s) {
1092+
return !strcmp(s.key.c_str(), name);
1093+
});
1094+
return it != var_set.end();
10901095
},
10911096
[&](st_persist_var &v) { m_persist_variables.insert(v); }, iter);
10921097
}

0 commit comments

Comments
 (0)