diff options
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc index 0f8e536cc5a..b3c3734b593 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2978,7 +2978,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) * Need to update the log pos because purge logs has been called * after fetching initially the log pos at the begining of the method. */ - if(error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0)) + if((error=find_log_pos(&rli->linfo, rli->event_relay_log_name, 0))) { char buff[22]; sql_print_error("next log error: %d offset: %s log: %s included: %d", @@ -3044,7 +3044,6 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, ulonglong *decrease_log_space) { int error; - int ret = 0; bool exit_loop= 0; LOG_INFO log_info; THD *thd= current_thd; @@ -3067,8 +3066,8 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, */ if (!my_b_inited(&purge_temp)) { - if (error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX, - DISK_BUFFER_SIZE, MYF(MY_WME))) + if ((error=open_cached_file(&purge_temp, mysql_tmpdir, TEMP_PREFIX, + DISK_BUFFER_SIZE, MYF(MY_WME)))) { sql_print_error("MYSQL_LOG::purge_logs failed to open purge_temp"); goto err; @@ -3076,7 +3075,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, } else { - if (error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1)) + if ((error=reinit_io_cache(&purge_temp, WRITE_CACHE, 0, 0, 1))) { sql_print_error("MYSQL_LOG::purge_logs failed to reinit purge_temp " "for write"); @@ -3107,7 +3106,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, } /* We know how many files to delete. Update index file. */ - if (error=update_log_index(&log_info, need_update_threads)) + if ((error=update_log_index(&log_info, need_update_threads))) { sql_print_error("MSYQL_LOG::purge_logs failed to update the index file"); goto err; @@ -3116,7 +3115,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, DBUG_EXECUTE_IF("crash_after_update_index", abort();); /* Switch purge_temp for read. */ - if (error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0)) + if ((error=reinit_io_cache(&purge_temp, READ_CACHE, 0, 0, 0))) { sql_print_error("MSYQL_LOG::purge_logs failed to reinit purge_temp " "for read"); @@ -3251,6 +3250,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, } err: + close_cached_file(&purge_temp); if (need_mutex) pthread_mutex_unlock(&LOCK_index); DBUG_RETURN(error); |