diff options
author | Luis Soares <luis.soares@oracle.com> | 2010-12-07 16:11:13 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@oracle.com> | 2010-12-07 16:11:13 +0000 |
commit | 5d6e142b2b9a5973fc9b9a638e01e5b92223e4c8 (patch) | |
tree | b5babca4ee608dc5e5daf9722eeb5c8414974565 /sql/sql_reload.cc | |
parent | c872e3db8027e4e4638af9bd80b9d78c8a675a77 (diff) | |
parent | bd0709cc8726e2d189df71138488ff7b2b004460 (diff) | |
download | mariadb-git-5d6e142b2b9a5973fc9b9a638e01e5b92223e4c8.tar.gz |
BUG#46166
Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam.
Conflicts
=========
Text conflict in sql/log.cc
Text conflict in sql/log.h
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_priv.h
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r-- | sql/sql_reload.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc index 35f27408247..0810459cb49 100644 --- a/sql/sql_reload.cc +++ b/sql/sql_reload.cc @@ -33,7 +33,11 @@ @param thd Thread handler (can be NULL!) @param options What should be reset/reloaded (tables, privileges, slave...) @param tables Tables to flush (if any) - @param write_to_binlog True if we can write to the binlog. + @param write_to_binlog < 0 if there was an error while interacting with the binary log inside + reload_acl_and_cache, + 0 if we should not write to the binary log, + > 0 if we can write to the binlog. + @note Depending on 'options', it may be very bad to write the query to the binlog (e.g. FLUSH SLAVE); this is a @@ -47,11 +51,11 @@ */ bool reload_acl_and_cache(THD *thd, unsigned long options, - TABLE_LIST *tables, bool *write_to_binlog) + TABLE_LIST *tables, int *write_to_binlog) { bool result=0; select_errors=0; /* Write if more errors */ - bool tmp_write_to_binlog= 1; + int tmp_write_to_binlog= *write_to_binlog= 1; DBUG_ASSERT(!thd || !thd->in_sub_stmt); @@ -136,13 +140,17 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, */ tmp_write_to_binlog= 0; if (mysql_bin_log.is_open()) - mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); + { + if (mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE)) + *write_to_binlog= -1; + } } if (options & REFRESH_RELAY_LOG) { #ifdef HAVE_REPLICATION mysql_mutex_lock(&LOCK_active_mi); - rotate_relay_log(active_mi); + if (rotate_relay_log(active_mi)) + *write_to_binlog= -1; mysql_mutex_unlock(&LOCK_active_mi); #endif } @@ -274,7 +282,8 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, #endif if (options & REFRESH_USER_RESOURCES) reset_mqh((LEX_USER *) NULL, 0); /* purecov: inspected */ - *write_to_binlog= tmp_write_to_binlog; + if (*write_to_binlog != -1) + *write_to_binlog= tmp_write_to_binlog; /* If the query was killed then this function must fail. */ |