Cleanup log_type_arg of MYSQL_BIN_LOG::open()
It is always LOG_BIN anyway.
This commit is contained in:
parent
e976d95614
commit
6b0b25a25b
11
sql/log.cc
11
sql/log.cc
@ -3448,7 +3448,6 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg,
|
||||
*/
|
||||
|
||||
bool MYSQL_BIN_LOG::open(const char *log_name,
|
||||
enum_log_type log_type_arg,
|
||||
const char *new_name,
|
||||
ulong next_log_number,
|
||||
enum cache_type io_cache_type_arg,
|
||||
@ -3459,7 +3458,6 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
|
||||
File file= -1;
|
||||
xid_count_per_binlog *new_xid_list_entry= NULL, *b;
|
||||
DBUG_ENTER("MYSQL_BIN_LOG::open");
|
||||
DBUG_PRINT("enter",("log_type: %d",(int) log_type_arg));
|
||||
|
||||
mysql_mutex_assert_owner(&LOCK_log);
|
||||
|
||||
@ -3479,7 +3477,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
|
||||
|
||||
/* We need to calculate new log file name for purge to delete old */
|
||||
if (init_and_set_log_file_name(log_name, new_name, next_log_number,
|
||||
log_type_arg, io_cache_type_arg))
|
||||
LOG_BIN, io_cache_type_arg))
|
||||
{
|
||||
sql_print_error("MYSQL_BIN_LOG::open failed to generate new file name.");
|
||||
DBUG_RETURN(1);
|
||||
@ -4313,7 +4311,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD *thd, bool create_new_log,
|
||||
}
|
||||
}
|
||||
if (create_new_log && !open_index_file(index_file_name, 0, FALSE))
|
||||
if (unlikely((error= open(save_name, log_type, 0, next_log_number,
|
||||
if (unlikely((error= open(save_name, 0, next_log_number,
|
||||
io_cache_type, max_size, 0, FALSE))))
|
||||
goto err;
|
||||
my_free((void *) save_name);
|
||||
@ -5305,8 +5303,7 @@ int MYSQL_BIN_LOG::new_file_impl()
|
||||
{
|
||||
/* reopen the binary log file. */
|
||||
file_to_open= new_name_ptr;
|
||||
error= open(old_name, log_type, new_name_ptr, 0, io_cache_type,
|
||||
max_size, 1, FALSE);
|
||||
error= open(old_name, new_name_ptr, 0, io_cache_type, max_size, 1, FALSE);
|
||||
}
|
||||
|
||||
/* handle reopening errors */
|
||||
@ -9681,7 +9678,7 @@ int TC_LOG_BINLOG::open(const char *opt_name)
|
||||
{
|
||||
mysql_mutex_lock(&LOCK_log);
|
||||
/* generate a new binlog to mask a corrupted one */
|
||||
open(opt_name, LOG_BIN, 0, 0, WRITE_CACHE, max_binlog_size, 0, TRUE);
|
||||
open(opt_name, 0, 0, WRITE_CACHE, max_binlog_size, 0, TRUE);
|
||||
mysql_mutex_unlock(&LOCK_log);
|
||||
cleanup();
|
||||
return 1;
|
||||
|
@ -773,7 +773,6 @@ public:
|
||||
void init_pthread_objects();
|
||||
void cleanup();
|
||||
bool open(const char *log_name,
|
||||
enum_log_type log_type,
|
||||
const char *new_name,
|
||||
ulong next_log_number,
|
||||
enum cache_type io_cache_type_arg,
|
||||
|
@ -5278,7 +5278,7 @@ static int init_server_components()
|
||||
int error;
|
||||
mysql_mutex_t *log_lock= mysql_bin_log.get_log_lock();
|
||||
mysql_mutex_lock(log_lock);
|
||||
error= mysql_bin_log.open(opt_bin_logname, LOG_BIN, 0, 0,
|
||||
error= mysql_bin_log.open(opt_bin_logname, 0, 0,
|
||||
WRITE_CACHE, max_binlog_size, 0, TRUE);
|
||||
mysql_mutex_unlock(log_lock);
|
||||
if (unlikely(error))
|
||||
|
@ -237,7 +237,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name);
|
||||
*/
|
||||
mysql_mutex_lock(log_lock);
|
||||
if (relay_log.open_index_file(buf_relaylog_index_name, ln, TRUE) ||
|
||||
relay_log.open(ln, LOG_BIN, 0, 0, SEQ_READ_APPEND,
|
||||
relay_log.open(ln, 0, 0, SEQ_READ_APPEND,
|
||||
(ulong)max_relay_log_size, 1, TRUE))
|
||||
{
|
||||
mysql_mutex_unlock(log_lock);
|
||||
@ -1178,7 +1178,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset,
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
mysql_mutex_lock(rli->relay_log.get_log_lock());
|
||||
if (rli->relay_log.open(ln, LOG_BIN, 0, 0, SEQ_READ_APPEND,
|
||||
if (rli->relay_log.open(ln, 0, 0, SEQ_READ_APPEND,
|
||||
(ulong)(rli->max_relay_log_size ? rli->max_relay_log_size :
|
||||
max_binlog_size), 1, TRUE))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user