• Luis Soares's avatar
    BUG#40611: MySQL cannot make a binary log after sequential number · 2fe9fb2b
    Luis Soares authored
    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.
    2fe9fb2b
binlog_max_extension.result 341 Bytes