diff options
author | Luis Soares <luis.soares@sun.com> | 2009-10-20 09:39:40 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-10-20 09:39:40 +0100 |
commit | 6395cb8ecf18f7cae5464dc56a7c9d1dbfe827c6 (patch) | |
tree | d838ff195cb6f4a67a1bc6392fee982553fc751b /sql | |
parent | 0b43c4e74c81ff136093c3238e03fb0c38b562fd (diff) | |
download | mariadb-git-6395cb8ecf18f7cae5464dc56a7c9d1dbfe827c6.tar.gz |
BUG#34582: FLUSH LOGS does not close and reopen the binlog index
file
Issuing 'FLUSH LOGS' does not close and reopen indexfile.
Instead a SEEK_SET is performed.
This patch makes index file to be closed and reopened whenever a
rotation happens (FLUSH LOGS is issued or binary log exceeds
maximum configured size).
mysql-test/suite/binlog/r/binlog_delete_and_flush_index.result:
Result file.
mysql-test/suite/binlog/t/binlog_delete_and_flush_index.test:
Test case.
sql/log.cc:
Added LOG_CLOSE_INDEX flag when calling MYSQL_BIN_LOG::close
from within MYSQL_BIN_LOG::new_file_impl (which should just be
called whenever a rotation is to happen - FLUSH LOGS issued or
binlog size exceeds the maximum configured).
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/log.cc b/sql/log.cc index e1c3944392f..e0eb97782a1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3603,7 +3603,7 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) } old_name=name; name=0; // Don't free name - close(LOG_CLOSE_TO_BE_OPENED); + close(LOG_CLOSE_TO_BE_OPENED | LOG_CLOSE_INDEX); /* Note that at this point, log_state != LOG_CLOSED (important for is_open()). @@ -3618,8 +3618,10 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) trigger temp tables deletion on slaves. */ - open(old_name, log_type, new_name_ptr, - io_cache_type, no_auto_events, max_size, 1); + /* reopen index binlog file, BUG#34582 */ + if (!open_index_file(index_file_name, 0)) + open(old_name, log_type, new_name_ptr, + io_cache_type, no_auto_events, max_size, 1); my_free(old_name,MYF(0)); end: |