diff options
author | unknown <nick@mysql.com> | 2002-10-07 15:42:10 -0600 |
---|---|---|
committer | unknown <nick@mysql.com> | 2002-10-07 15:42:10 -0600 |
commit | f48480b952bef7654001ce59ce3b86065c2f04bf (patch) | |
tree | 9997d085fbe0c80ca2c5861d96de3a8da03bbae6 /sql/log.cc | |
parent | dc8e1b1e812ad5696707d4f69e1ccb706873595f (diff) | |
download | mariadb-git-f48480b952bef7654001ce59ce3b86065c2f04bf.tar.gz |
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
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/log.cc b/sql/log.cc index b90659fdf55..e3f85c8def5 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -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)); } |