summaryrefslogtreecommitdiff
path: root/sql/sql_reload.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2014-09-28 20:43:56 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2014-09-28 20:43:56 -0400
commitc916085e271cd049537b1e07b36cd060c44750bd (patch)
tree337ddfcd033174143cf9bd08e6ba50174459d7ff /sql/sql_reload.cc
parent023366e6eb68edca3858c32e7492788e047d927a (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-c916085e271cd049537b1e07b36cd060c44750bd.tar.gz
bzr merge -rtag:mariadb-10.0.14 maria/10.0/
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r--sql/sql_reload.cc57
1 files changed, 31 insertions, 26 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index f1f9ba9452f..e2b3b482ffe 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -174,18 +174,21 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
*/
tmp_write_to_binlog= 0;
mysql_mutex_lock(&LOCK_active_mi);
- if (!(mi= (master_info_index->
- get_master_info(&connection_name,
- Sql_condition::WARN_LEVEL_ERROR))))
+ if (master_info_index)
{
- result= 1;
- }
- else
- {
- mysql_mutex_lock(&mi->data_lock);
- if (rotate_relay_log(mi))
- *write_to_binlog= -1;
- mysql_mutex_unlock(&mi->data_lock);
+ if (!(mi= (master_info_index->
+ get_master_info(&connection_name,
+ Sql_condition::WARN_LEVEL_ERROR))))
+ {
+ result= 1;
+ }
+ else
+ {
+ mysql_mutex_lock(&mi->data_lock);
+ if (rotate_relay_log(mi))
+ *write_to_binlog= -1;
+ mysql_mutex_unlock(&mi->data_lock);
+ }
}
mysql_mutex_unlock(&LOCK_active_mi);
#endif
@@ -357,22 +360,24 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
Master_info *mi;
tmp_write_to_binlog= 0;
mysql_mutex_lock(&LOCK_active_mi);
-
- if (!(mi= (master_info_index->
- get_master_info(&lex_mi->connection_name,
- Sql_condition::WARN_LEVEL_ERROR))))
+ if (master_info_index)
{
- result= 1;
- }
- else if (reset_slave(thd, mi))
- {
- /* NOTE: my_error() has been already called by reset_slave(). */
- result= 1;
- }
- else if (mi->connection_name.length && thd->lex->reset_slave_info.all)
- {
- /* If not default connection and 'all' is used */
- master_info_index->remove_master_info(&mi->connection_name);
+ if (!(mi= (master_info_index->
+ get_master_info(&lex_mi->connection_name,
+ Sql_condition::WARN_LEVEL_ERROR))))
+ {
+ result= 1;
+ }
+ else if (reset_slave(thd, mi))
+ {
+ /* NOTE: my_error() has been already called by reset_slave(). */
+ result= 1;
+ }
+ else if (mi->connection_name.length && thd->lex->reset_slave_info.all)
+ {
+ /* If not default connection and 'all' is used */
+ master_info_index->remove_master_info(&mi->connection_name);
+ }
}
mysql_mutex_unlock(&LOCK_active_mi);
}