diff options
author | jonas@perch.ndb.mysql.com <> | 2006-09-04 13:43:34 +0200 |
---|---|---|
committer | jonas@perch.ndb.mysql.com <> | 2006-09-04 13:43:34 +0200 |
commit | 96ff8b4c521aba696ba62154605ea2a04a927c6e (patch) | |
tree | 2f11faf90e49ea4e1e47cec032231077bb5adbfd /sql/sql_repl.cc | |
parent | b60be73461bb295b8b797a49c1a1b8b97baa55fe (diff) | |
download | mariadb-git-96ff8b4c521aba696ba62154605ea2a04a927c6e.tar.gz |
bug#21965 - replication
fix deadlock if master switches log file in parallell with "show master logs"
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 963c4ccf5a6..2a7ab55b8c4 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1359,10 +1359,14 @@ int show_binlogs(THD* thd) MYSQL_TYPE_LONGLONG)); if (protocol->send_fields(&field_list, 1)) DBUG_RETURN(1); + + pthread_mutex_lock(mysql_bin_log.get_log_lock()); mysql_bin_log.lock_index(); index_file=mysql_bin_log.get_index_file(); - - mysql_bin_log.get_current_log(&cur); + + mysql_bin_log.raw_get_current_log(&cur); // dont take mutex + pthread_mutex_unlock(mysql_bin_log.get_log_lock()); // lockdep, OK + cur_dir_len= dirname_length(cur.log_file_name); reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0); |