diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-04-17 15:18:44 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2015-04-17 15:18:44 +0200 |
commit | 167332597f03f73057fbb4684687a013596181bd (patch) | |
tree | 1256610eb3a54a2e6f847badea452e3fc274a5c0 /sql/rpl_mi.cc | |
parent | 8125db1d9ae489162f08560f42c60c10a316afbc (diff) | |
parent | 702fdc52fa02c5f20004d169ad48494122d8ffed (diff) | |
download | mariadb-git-167332597f03f73057fbb4684687a013596181bd.tar.gz |
Merge 10.0 -> 10.1.
Conflicts:
mysql-test/suite/multi_source/multisource.result
sql/sql_base.cc
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r-- | sql/rpl_mi.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 8ce67bbf4b8..a56a4e5dc7b 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1368,7 +1368,7 @@ bool Master_info_index::remove_master_info(LEX_STRING *name) bool Master_info_index::give_error_if_slave_running() { - DBUG_ENTER("warn_if_slave_running"); + DBUG_ENTER("give_error_if_slave_running"); mysql_mutex_assert_owner(&LOCK_active_mi); if (!this) // master_info_index is set to NULL on server shutdown return TRUE; @@ -1389,6 +1389,32 @@ bool Master_info_index::give_error_if_slave_running() /** + Master_info_index::any_slave_sql_running() + + The LOCK_active_mi must be held while calling this function. + + @return + TRUE If some slave SQL thread is running. + FALSE No slave SQL thread is running +*/ + +bool Master_info_index::any_slave_sql_running() +{ + DBUG_ENTER("any_slave_sql_running"); + if (!this) // master_info_index is set to NULL on server shutdown + return TRUE; + + for (uint i= 0; i< master_info_hash.records; ++i) + { + Master_info *mi= (Master_info *)my_hash_element(&master_info_hash, i); + if (mi->rli.slave_running != MYSQL_SLAVE_NOT_RUN) + DBUG_RETURN(TRUE); + } + DBUG_RETURN(FALSE); +} + + +/** Master_info_index::start_all_slaves() Start all slaves that was not running. |