summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-09-04 13:46:56 +0200
committerunknown <jonas@perch.ndb.mysql.com>2006-09-04 13:46:56 +0200
commit14bebaa2dcbea89c5deb66eef8e4f07bdfbd9f93 (patch)
treefef84ee30cc67f08a1ac7d27909fe21b378a244e
parentb931e3ebad93999f418364dd6e7f05bafee663b2 (diff)
parentd2d605e4ea578cf49adb52ebd834363962d099d8 (diff)
downloadmariadb-git-14bebaa2dcbea89c5deb66eef8e4f07bdfbd9f93.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/41-work
into perch.ndb.mysql.com:/home/jonas/src/50-work sql/log.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_repl.cc: merge
-rw-r--r--sql/log.cc9
-rw-r--r--sql/sql_class.h1
-rw-r--r--sql/sql_repl.cc8
3 files changed, 14 insertions, 4 deletions
diff --git a/sql/log.cc b/sql/log.cc
index ebd1d10d8b7..2a546e47ded 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -723,13 +723,18 @@ shutdown the MySQL server and restart it.", name, errno);
int MYSQL_LOG::get_current_log(LOG_INFO* linfo)
{
pthread_mutex_lock(&LOCK_log);
+ int ret = raw_get_current_log(linfo);
+ pthread_mutex_unlock(&LOCK_log);
+ return ret;
+}
+
+int MYSQL_LOG::raw_get_current_log(LOG_INFO* linfo)
+{
strmake(linfo->log_file_name, log_file_name, sizeof(linfo->log_file_name)-1);
linfo->pos = my_b_tell(&log_file);
- pthread_mutex_unlock(&LOCK_log);
return 0;
}
-
/*
Move all data up in a file in an filename index file
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 5134efcfb32..9475d4e5780 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -342,6 +342,7 @@ public:
bool need_mutex);
int find_next_log(LOG_INFO* linfo, bool need_mutex);
int get_current_log(LOG_INFO* linfo);
+ int raw_get_current_log(LOG_INFO* linfo);
uint next_file_id();
inline bool is_open() { return log_type != LOG_CLOSED; }
inline char* get_index_fname() { return index_file_name;}
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index ccda69522c7..e1933d42f9e 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1494,10 +1494,14 @@ bool show_binlogs(THD* thd)
if (protocol->send_fields(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
DBUG_RETURN(TRUE);
+
+ 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);