summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Elkin <andrei.elkin@mariadb.com>2019-03-30 18:45:46 +0200
committerAndrei Elkin <andrei.elkin@mariadb.com>2019-03-30 18:45:46 +0200
commit5ee978fb85d698c31098d78991d50e2c838bdf6e (patch)
tree70b37389017a7209d6db39cdbbb6cef93483e238
parent8c9f2e8f2d3769f3f7cb658ceea7523def3ab9b7 (diff)
downloadmariadb-git-bb-10.4-andrei_for_monty2.tar.gz
Review of 05cae92e524: last_used_log_number increment is made to follow last_binlog_id pattern.bb-10.4-andrei_for_monty2
-rw-r--r--sql/log.cc9
-rw-r--r--sql/log.h3
2 files changed, 5 insertions, 7 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 5df144fb278..7709a8904bc 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2539,6 +2539,7 @@ static int find_uniq_filename(char *name, ulong min_log_number_to_use,
}
}
my_dirend(dir_info);
+ *last_used_log_number= max_found;
}
/* check if reached the maximum possible extension number */
@@ -2578,7 +2579,6 @@ index files.", name, ext_buf, (strlen(ext_buf) + (end - name)));
error= 1;
goto end;
}
- *last_used_log_number= next;
/* print warning if reaching the end of available extensions. */
if ((next > (MAX_LOG_UNIQUE_FN_EXT - LOG_WARN_UNIQUE_FN_EXT_LEFT)))
@@ -3801,6 +3801,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
}
}
+ ++last_used_log_number;
if (!is_relay_log)
{
/*
@@ -5227,7 +5228,7 @@ int MYSQL_BIN_LOG::new_file_impl()
#ifdef ENABLE_AND_FIX_HANG
close_on_error= TRUE;
#endif
- goto end2;
+ goto end;
}
new_name_ptr=new_name;
@@ -5330,11 +5331,7 @@ int MYSQL_BIN_LOG::new_file_impl()
my_free(old_name);
end:
- /* In case of errors, reuse the last generated log file name */
- if (unlikely(error))
- last_used_log_number--;
-end2:
if (delay_close)
{
clear_inuse_flag_when_closing(old_file);
diff --git a/sql/log.h b/sql/log.h
index e463a73446a..ff0f62ccaa3 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -504,7 +504,8 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
GLOBAL MAX_BINLOG_SIZE|MAX_RELAY_LOG_SIZE) from sys_vars.cc
*/
ulong max_size;
- ulong last_used_log_number; // Cache for find_uniq_filename
+ /* The counter corresponds to the index of the current binlog file. */
+ ulong last_used_log_number;
// current file sequence number for load data infile binary logging
uint file_id;
uint open_count; // For replication