summaryrefslogtreecommitdiff
path: root/sql/rpl_mi.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-07-15 16:27:14 +0300
committerMonty <monty@mariadb.org>2015-07-16 10:36:58 +0300
commit872a953b228e93553ed056d8fa035ff06e884bc8 (patch)
treea90958d21c610b2517705ab79666aacd8c837e84 /sql/rpl_mi.cc
parentdf0498fd76897c0e034ab3f0598972f0e2419b02 (diff)
downloadmariadb-git-872a953b228e93553ed056d8fa035ff06e884bc8.tar.gz
MDEV-8469 Add RESET MASTER TO x to allow specification of binlog file nr
Other things: - Avoid calling init_and_set_log_file_name() when opening binary log. - Remove newlines early when reading from index file. - Ensure that reset_logs() will work even if thd is 0 (Can happen on startup) - Added thd to sart_slave_threads() for better error handling.
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r--sql/rpl_mi.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index e347376762d..02104af8cd3 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -1127,12 +1127,13 @@ bool Master_info_index::init_all_master_info()
if (!opt_skip_slave_start)
{
- if (start_slave_threads(1 /* need mutex */,
- 0 /* no wait for start*/,
- mi,
- buf_master_info_file,
- buf_relay_log_info_file,
- SLAVE_IO | SLAVE_SQL))
+ if (start_slave_threads(current_thd,
+ 1 /* need mutex */,
+ 0 /* no wait for start*/,
+ mi,
+ buf_master_info_file,
+ buf_relay_log_info_file,
+ SLAVE_IO | SLAVE_SQL))
{
sql_print_error("Failed to create slave threads for connection '%.*s'",
(int) connection_name.length,
@@ -1455,7 +1456,7 @@ bool Master_info_index::start_all_slaves(THD *thd)
if (error < 0) // fatal error
break;
}
- else
+ else if (thd)
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_SLAVE_STARTED, ER_THD(thd, ER_SLAVE_STARTED),
(int) mi->connection_name.length,
@@ -1471,6 +1472,8 @@ bool Master_info_index::start_all_slaves(THD *thd)
Start all slaves that was not running.
+ @param thread id from user
+
@return
TRUE Error
FALSE Everything ok.
@@ -1481,6 +1484,7 @@ bool Master_info_index::stop_all_slaves(THD *thd)
bool result= FALSE;
DBUG_ENTER("warn_if_slave_running");
mysql_mutex_assert_owner(&LOCK_active_mi);
+ DBUG_ASSERT(thd);
for (uint i= 0; i< master_info_hash.records; ++i)
{