Skip to content

Commit 9f01095

Browse files
author
Bharathy Satish
committed
WL#8688 Support ability to persist SET GLOBAL settings
Postpush fix for UBSAN test failure.
1 parent 1fae015 commit 9f01095

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

mysys_ssl/my_default.cc

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,24 +1483,25 @@ void update_variable_source(const char* opt_name, const char* value)
14831483
}
14841484

14851485
std::map<string, enum_variable_source>::iterator it= default_paths.find(path);
1486-
my_variable_sources source;
14871486
if (it != default_paths.end())
14881487
{
1488+
my_variable_sources source;
1489+
std::pair<std::map<string, my_variable_sources>::iterator,bool> ret;
1490+
14891491
source.m_config_file_name= path;
14901492
source.m_source= it->second;
1493+
ret= variables_hash.insert(std::pair<string,
1494+
my_variable_sources>(var_name, source));
1495+
/*
1496+
If value exists replace it with new path. ex: if there exists
1497+
same variables in my.cnf and mysqld-auto.cnf and specified in
1498+
command line options, then final entry into this hash will be
1499+
option name as key and mysqld-auto.cnf file path + PERSISTED
1500+
as value.
1501+
*/
1502+
if (ret.second == false)
1503+
variables_hash[var_name]= source;
14911504
}
1492-
1493-
std::pair<std::map<string, my_variable_sources>::iterator,bool> ret;
1494-
ret= variables_hash.insert(std::pair<string, my_variable_sources>(var_name, source));
1495-
/*
1496-
If value exists replace it with new path. ex: if there exists
1497-
same variables in my.cnf and mysqld-auto.cnf and specified in
1498-
command line options, then final entry into this hash will be
1499-
option name as key and mysqld-auto.cnf file path + PERSISTED
1500-
as value.
1501-
*/
1502-
if (ret.second == false)
1503-
variables_hash[var_name]= source;
15041505
}
15051506

15061507
/**

0 commit comments

Comments
 (0)