1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

fixed race that caused sig11s on simultaneous FLUSH LOGS

(possibly also fixes binlog filename corruption problems--hasn't
been reproduced since)
This commit is contained in:
nick@mysql.com
2002-10-07 15:42:10 -06:00
parent 66646cc458
commit ec04d28468
3 changed files with 10 additions and 9 deletions

View File

@ -30,3 +30,4 @@ zak@balfor.local
bar@bar.mysql.r18.ru bar@bar.mysql.r18.ru
paul@teton.kitebird.com paul@teton.kitebird.com
serg@build.mysql2.com serg@build.mysql2.com
nick@mysql.com

View File

@ -513,11 +513,11 @@ bool MYSQL_LOG::is_active(const char* log_file_name)
void MYSQL_LOG::new_file(bool inside_mutex) void MYSQL_LOG::new_file(bool inside_mutex)
{ {
if (!inside_mutex)
VOID(pthread_mutex_lock(&LOCK_log));
if (is_open()) if (is_open())
{ {
char new_name[FN_REFLEN], *old_name=name; char new_name[FN_REFLEN], *old_name=name;
if (!inside_mutex)
VOID(pthread_mutex_lock(&LOCK_log));
if (!no_rotate) if (!no_rotate)
{ {
@ -550,10 +550,10 @@ void MYSQL_LOG::new_file(bool inside_mutex)
my_free(old_name,MYF(0)); my_free(old_name,MYF(0));
last_time=query_start=0; last_time=query_start=0;
write_error=0; write_error=0;
}
if (!inside_mutex) if (!inside_mutex)
VOID(pthread_mutex_unlock(&LOCK_log)); VOID(pthread_mutex_unlock(&LOCK_log));
} }
}
bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,

View File

@ -2839,10 +2839,10 @@ bool reload_acl_and_cache(THD *thd, uint options, TABLE_LIST *tables)
} }
if (options & REFRESH_LOG) if (options & REFRESH_LOG)
{ {
mysql_log.new_file(); mysql_log.new_file(0);
mysql_update_log.new_file(); mysql_update_log.new_file(0);
mysql_bin_log.new_file(); mysql_bin_log.new_file(0);
mysql_slow_log.new_file(); mysql_slow_log.new_file(0);
if (ha_flush_logs()) if (ha_flush_logs())
result=1; result=1;
} }