diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/rpl_mi.cc | 17 | ||||
-rw-r--r-- | sql/rpl_mi.h | 1 | ||||
-rw-r--r-- | sql/sql_reload.cc | 8 |
3 files changed, 24 insertions, 2 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index c9dcf7b8fd7..3b32afb75bd 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1980,4 +1980,21 @@ void prot_store_ids(THD *thd, DYNAMIC_ARRAY *ids) return; } +bool Master_info_index::flush_all_relay_logs() +{ + for (uint i=0; i < master_info_hash.records; i++) + { + Master_info *mi; + mi= (Master_info *)my_hash_element(&master_info_hash, i); + mysql_mutex_lock(&mi->data_lock); + if (rotate_relay_log(mi)) + { + mysql_mutex_unlock(&mi->data_lock); + return true; + } + mysql_mutex_unlock(&mi->data_lock); + } + return false; +} + #endif /* HAVE_REPLICATION */ diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index 31c0f280ac1..03ca5d00e41 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -354,6 +354,7 @@ public: bool start_all_slaves(THD *thd); bool stop_all_slaves(THD *thd); void free_connections(); + bool flush_all_relay_logs(); }; diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 995c4c0a838..376dfeb1542 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -181,8 +181,12 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options, slave is not likely to have the same connection names. */ tmp_write_to_binlog= 0; - - if (!(mi= (get_master_info(&connection_name, + if (connection_name.length == 0) + { + if (master_info_index->flush_all_relay_logs()) + *write_to_binlog= -1; + } + else if (!(mi= (get_master_info(&connection_name, Sql_condition::WARN_LEVEL_ERROR)))) { result= 1; |