summaryrefslogtreecommitdiff
path: root/sql/sql_reload.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-09-23 20:49:23 +0400
committerAlexander Nozdrin <alexander.nozdrin@oracle.com>2011-09-23 20:49:23 +0400
commitbccea2cc5dc99f247687cf2bd64815f3e45268a0 (patch)
tree877decd533ae5c971c0758aa485413202ba714f7 /sql/sql_reload.cc
parentb6bcb8146ca9fdc84a856fc747beb5ff5099ba25 (diff)
parent41dc3049281c1718e49d80eaf0cf068def9519b5 (diff)
downloadmariadb-git-bccea2cc5dc99f247687cf2bd64815f3e45268a0.tar.gz
Manual merge from mysql-5.1-security.
Diffstat (limited to 'sql/sql_reload.cc')
-rw-r--r--sql/sql_reload.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc
index b567e3a1f85..ae4c3999838 100644
--- a/sql/sql_reload.cc
+++ b/sql/sql_reload.cc
@@ -118,7 +118,14 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
if (options & REFRESH_ERROR_LOG)
if (flush_error_log())
+ {
+ /*
+ When flush_error_log() failed, my_error() has not been called.
+ So, we have to do it here to keep the protocol.
+ */
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
result= 1;
+ }
if ((options & REFRESH_SLOW_LOG) && opt_slow_log)
logger.flush_slow_log();
@@ -200,7 +207,13 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
if (close_cached_tables(thd, tables,
((options & REFRESH_FAST) ? FALSE : TRUE),
thd->variables.lock_wait_timeout))
+ {
+ /*
+ NOTE: my_error() has been already called by reopen_tables() within
+ close_cached_tables().
+ */
result= 1;
+ }
if (thd->global_read_lock.make_global_read_lock_block_commit(thd)) // Killed
{
@@ -256,7 +269,13 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
((options & REFRESH_FAST) ? FALSE : TRUE),
(thd ? thd->variables.lock_wait_timeout :
LONG_TIMEOUT)))
+ {
+ /*
+ NOTE: my_error() has been already called by reopen_tables() within
+ close_cached_tables().
+ */
result= 1;
+ }
}
my_dbopt_cleanup();
}
@@ -273,7 +292,8 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
tmp_write_to_binlog= 0;
if (reset_master(thd))
{
- result=1;
+ /* NOTE: my_error() has been already called by reset_master(). */
+ result= 1;
}
}
#endif
@@ -281,7 +301,10 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
if (options & REFRESH_DES_KEY_FILE)
{
if (des_key_file && load_des_key_file(des_key_file))
- result= 1;
+ {
+ /* NOTE: my_error() has been already called by load_des_key_file(). */
+ result= 1;
+ }
}
#endif
#ifdef HAVE_REPLICATION
@@ -290,7 +313,10 @@ bool reload_acl_and_cache(THD *thd, unsigned long options,
tmp_write_to_binlog= 0;
mysql_mutex_lock(&LOCK_active_mi);
if (reset_slave(thd, active_mi))
- result=1;
+ {
+ /* NOTE: my_error() has been already called by reset_slave(). */
+ result= 1;
+ }
mysql_mutex_unlock(&LOCK_active_mi);
}
#endif