summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorChad MILLER <chad@mysql.com>2008-07-10 14:47:53 -0400
committerChad MILLER <chad@mysql.com>2008-07-10 14:47:53 -0400
commit6a6e77eeffc7dbd72888ef685fdb93fc2ae7aed6 (patch)
treed78d316822f255f22093dc0cc26ea8943b5f91d4 /sql/slave.cc
parent5e0d806d276d27fef1a5dfcdca92f010836510ed (diff)
parent1aaa63aabaef8015c71fc6143b3062e197049707 (diff)
downloadmariadb-git-6a6e77eeffc7dbd72888ef685fdb93fc2ae7aed6.tar.gz
Merge chunk from trunk.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index d90779cec02..4cb36b8f401 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2447,14 +2447,15 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
protocol->prepare_for_resend();
/*
- TODO: we read slave_running without run_lock, whereas these variables
- are updated under run_lock and not data_lock. In 5.0 we should lock
- run_lock on top of data_lock (with good order).
+ slave_running can be accessed without run_lock but not other
+ non-volotile members like mi->io_thd, which is guarded by the mutex.
*/
+ pthread_mutex_lock(&mi->run_lock);
+ protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
+ pthread_mutex_unlock(&mi->run_lock);
+
pthread_mutex_lock(&mi->data_lock);
pthread_mutex_lock(&mi->rli.data_lock);
-
- protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin);
protocol->store(mi->host, &my_charset_bin);
protocol->store(mi->user, &my_charset_bin);
protocol->store((uint32) mi->port);
@@ -3338,7 +3339,7 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
}
DBUG_PRINT("info", ("thd->options: %s",
- (thd->options & OPTION_BEGIN) ? "OPTION_BEGIN" : ""))
+ (thd->options & OPTION_BEGIN) ? "OPTION_BEGIN" : ""));
/*
Protect against common user error of setting the counter to 1
@@ -3348,7 +3349,10 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
if (rli->slave_skip_counter &&
!((type_code == INTVAR_EVENT ||
type_code == RAND_EVENT ||
- type_code == USER_VAR_EVENT) &&
+ type_code == USER_VAR_EVENT ||
+ type_code == BEGIN_LOAD_QUERY_EVENT ||
+ type_code == APPEND_BLOCK_EVENT ||
+ type_code == CREATE_FILE_EVENT) &&
rli->slave_skip_counter == 1) &&
#if MYSQL_VERSION_ID < 50100
/*