Commit 642b7593 authored by unknown's avatar unknown

fixed race that caused sig11s on simultaneous FLUSH LOGS

(possibly also fixes binlog filename corruption problems--hasn't
been reproduced since)


sql/log.cc:
  Fixed race caused by calling MYSQL_LOG::is_open() outside of critical section.
sql/sql_parse.cc:
  added missing args to calls to MYSQL_LOG::new_file(bool)
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent 18585d17
......@@ -30,3 +30,4 @@ zak@balfor.local
bar@bar.mysql.r18.ru
paul@teton.kitebird.com
serg@build.mysql2.com
nick@mysql.com
......@@ -513,12 +513,12 @@ bool MYSQL_LOG::is_active(const char* log_file_name)
void MYSQL_LOG::new_file(bool inside_mutex)
{
if (!inside_mutex)
VOID(pthread_mutex_lock(&LOCK_log));
if (is_open())
{
char new_name[FN_REFLEN], *old_name=name;
if (!inside_mutex)
VOID(pthread_mutex_lock(&LOCK_log));
if (!no_rotate)
{
/*
......@@ -550,9 +550,9 @@ void MYSQL_LOG::new_file(bool inside_mutex)
my_free(old_name,MYF(0));
last_time=query_start=0;
write_error=0;
if (!inside_mutex)
VOID(pthread_mutex_unlock(&LOCK_log));
}
if (!inside_mutex)
VOID(pthread_mutex_unlock(&LOCK_log));
}
......
......@@ -2839,10 +2839,10 @@ bool reload_acl_and_cache(THD *thd, uint options, TABLE_LIST *tables)
}
if (options & REFRESH_LOG)
{
mysql_log.new_file();
mysql_update_log.new_file();
mysql_bin_log.new_file();
mysql_slow_log.new_file();
mysql_log.new_file(0);
mysql_update_log.new_file(0);
mysql_bin_log.new_file(0);
mysql_slow_log.new_file(0);
if (ha_flush_logs())
result=1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment