Commit 60e1175e authored by nick@mysql.com's avatar nick@mysql.com

touchup to last fix

parent 20433597
...@@ -513,11 +513,13 @@ bool MYSQL_LOG::is_active(const char* log_file_name) ...@@ -513,11 +513,13 @@ 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 (!is_open())
return;
if (!inside_mutex) if (!inside_mutex)
VOID(pthread_mutex_lock(&LOCK_log)); VOID(pthread_mutex_lock(&LOCK_log));
if (is_open())
{ char new_name[FN_REFLEN], *old_name = name;
char new_name[FN_REFLEN], *old_name=name;
if (!no_rotate) if (!no_rotate)
{ {
...@@ -550,7 +552,7 @@ void MYSQL_LOG::new_file(bool inside_mutex) ...@@ -550,7 +552,7 @@ 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));
} }
...@@ -564,8 +566,8 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, ...@@ -564,8 +566,8 @@ bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
int error=0; int error=0;
VOID(pthread_mutex_lock(&LOCK_log)); VOID(pthread_mutex_lock(&LOCK_log));
/* Test if someone closed after the is_open test */ /* Test if someone closed between the is_open test and lock */
if (log_type != LOG_CLOSED) if (is_open())
{ {
time_t skr; time_t skr;
ulong id; ulong id;
......
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