Skip to content

Commit

Permalink
correctly calculate binlog index path during binlog_change_to_binlog
Browse files Browse the repository at this point in the history
Summary:
During promotion(binlog_change_to_binlog), the binary index file path is calculated incorrectly due to opt_binlog_index_name is a file name without path(such as binary-logs-{port}.index) but `mysql_bin_log.open_index_file()` requires either pass full binlog index name as 1st parameter or use 2nd parameter to calculate full binlog index file path.

Use 2nd parameter(opt_bin_logname) to calculate full binlog index file path.

Reviewed By: bhatvinay

Differential Revision: D27703333

fbshipit-source-id: c4827dbc9bc
  • Loading branch information
luqun authored and facebook-github-bot committed Apr 22, 2021
1 parent 216d7bd commit 17bf51f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sql/binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11744,7 +11744,9 @@ int binlog_change_to_binlog(THD *thd) {
mysql_bin_log.close(LOG_CLOSE_INDEX, /*need_lock_log=*/false,
/*need_lock_index=*/false);

if (mysql_bin_log.open_index_file(opt_binlog_index_name, opt_bin_logname,
// Use opt_bin_logname to calculate index file full path
if (mysql_bin_log.open_index_file(/*index_file_name_arg*/ nullptr,
opt_bin_logname,
/*need_lock_index=*/false)) {
error = 1;
goto err;
Expand Down

0 comments on commit 17bf51f

Please sign in to comment.