MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / fix_log

Function fix_log

sql/sys_vars.cc:1165–1183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163 return false;
1164}
1165static bool fix_log(char** logname, const char* default_logname,
1166 const char*ext, bool enabled, void (*reopen)(char*))
1167{
1168 if (!*logname) // SET ... = DEFAULT
1169 {
1170 char buff[FN_REFLEN];
1171 *logname= my_strdup(make_log_name(buff, default_logname, ext),
1172 MYF(MY_FAE+MY_WME));
1173 if (!*logname)
1174 return true;
1175 }
1176 logger.lock_exclusive();
1177 mysql_mutex_unlock(&LOCK_global_system_variables);
1178 if (enabled)
1179 reopen(*logname);
1180 logger.unlock();
1181 mysql_mutex_lock(&LOCK_global_system_variables);
1182 return false;
1183}
1184static void reopen_general_log(char* name)
1185{
1186 logger.get_log_file_handler()->close(0);

Callers 1

fix_general_log_fileFunction · 0.85

Calls 4

my_strdupFunction · 0.85
make_log_nameFunction · 0.85
lock_exclusiveMethod · 0.80
unlockMethod · 0.45

Tested by

no test coverage detected