summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-05-26 21:55:40 +0300
committerMichael Widenius <monty@askmonty.org>2010-05-26 21:55:40 +0300
commit4aa9d903c11554cc4887eeffe7f0592c52e8bc99 (patch)
treeaf3f0dfb833c3c4aabaa69ce50cfb64202ecd479 /sql/sql_repl.cc
parent9febcb4776e563a93eb8fff247174b0e2eb2ae0b (diff)
parentaf6d89a6aa9feb3545de068f461cf91bfb281dd2 (diff)
downloadmariadb-git-4aa9d903c11554cc4887eeffe7f0592c52e8bc99.tar.gz
Merge with MySQL 5.1.47
Fixed some bugs introduced in 5.1.47 Disabled some tests until we have merged with latest Xtradb configure.in: Added testing if valgrind/memcheck.h exists storage/pbxt/src/ha_pbxt.cc: LOCK_plugin is not anymore locked in init
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 3aa9e9ba56f..7772b4d1ed2 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1134,6 +1134,10 @@ bool change_master(THD* thd, Master_info* mi)
int thread_mask;
const char* errmsg= 0;
bool need_relay_log_purge= 1;
+ char saved_host[HOSTNAME_LENGTH + 1];
+ uint saved_port;
+ char saved_log_name[FN_REFLEN];
+ my_off_t saved_log_pos;
DBUG_ENTER("change_master");
lock_slave_threads(mi);
@@ -1163,6 +1167,14 @@ bool change_master(THD* thd, Master_info* mi)
*/
/*
+ Before processing the command, save the previous state.
+ */
+ strmake(saved_host, mi->host, HOSTNAME_LENGTH);
+ saved_port= mi->port;
+ strmake(saved_log_name, mi->master_log_name, FN_REFLEN - 1);
+ saved_log_pos= mi->master_log_pos;
+
+ /*
If the user specified host or port without binlog or position,
reset binlog's name to FIRST and position to 4.
*/
@@ -1325,6 +1337,15 @@ bool change_master(THD* thd, Master_info* mi)
/* Clear the errors, for a clean start */
mi->rli.clear_error();
mi->rli.clear_until_condition();
+
+ sql_print_information("'CHANGE MASTER TO executed'. "
+ "Previous state master_host='%s', master_port='%u', master_log_file='%s', "
+ "master_log_pos='%ld'. "
+ "New state master_host='%s', master_port='%u', master_log_file='%s', "
+ "master_log_pos='%ld'.", saved_host, saved_port, saved_log_name,
+ (ulong) saved_log_pos, mi->host, mi->port, mi->master_log_name,
+ (ulong) mi->master_log_pos);
+
/*
If we don't write new coordinates to disk now, then old will remain in
relay-log.info until START SLAVE is issued; but if mysqld is shutdown