diff options
author | Luis Soares <luis.soares@sun.com> | 2009-09-29 15:12:07 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-09-29 15:12:07 +0100 |
commit | b79b335033fae28f891217a28d898c018b380f03 (patch) | |
tree | c68a941f1cdc17f0238cdc3bde3e9ef3668e0555 /sql/log.h | |
parent | b538536718389bcac283d875a7d92527d8ef57be (diff) | |
download | mariadb-git-b79b335033fae28f891217a28d898c018b380f03.tar.gz |
BUG#40611: MySQL cannot make a binary log after sequential number
beyond unsigned long.
BUG#44779: binlog.binlog_max_extension may be causing failure on
next test in PB
NOTE1: this is the backport to next-mr.
NOTE2: already includes patch for BUG#44779.
Binlog file extensions would turn into negative numbers once the
variable used to hold the value reached maximum for signed
long. Consequently, incrementing value to the next (negative) number
would lead to .000000 extension, causing the server to fail.
This patch addresses this issue by not allowing negative extensions
and by returning an error on find_uniq_filename, when the limit is
reached. Additionally, warnings are printed to the error log when the
limit is approaching. FLUSH LOGS will also report warnings to the
user, if the extension number has reached the limit. The limit has been
set to 0x7FFFFFFF as the maximum.
mysql-test/suite/binlog/t/binlog_max_extension.test:
Test case added that checks the maximum available number for
binlog extensions.
sql/log.cc:
Changes to find_uniq_filename and test_if_number.
sql/log.h:
Added macros with values for MAX_LOG_UNIQUE_FN_EXT and
LOG_WARN_UNIQUE_FN_EXT_LEFT, as suggested in review.
Diffstat (limited to 'sql/log.h')
-rw-r--r-- | sql/log.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/log.h b/sql/log.h index d306d6f7182..3c2ccc521cc 100644 --- a/sql/log.h +++ b/sql/log.h @@ -121,6 +121,19 @@ extern TC_LOG_DUMMY tc_log_dummy; #define LOG_CLOSE_TO_BE_OPENED 2 #define LOG_CLOSE_STOP_EVENT 4 +/* + Maximum unique log filename extension. + Note: setting to 0x7FFFFFFF due to atol windows + overflow/truncate. + */ +#define MAX_LOG_UNIQUE_FN_EXT 0x7FFFFFFF + +/* + Number of warnings that will be printed to error log + before extension number is exhausted. +*/ +#define LOG_WARN_UNIQUE_FN_EXT_LEFT 1000 + class Relay_log_info; typedef struct st_log_info |