• 's avatar
    BUG#45999 Row based replication fails when auto_increment field = 0 · df67d149
    authored
    In RBR, There is an inconsistency between slaves and master.
    When INSERT statement which includes an auto_increment field is executed,
    Store engine of master will check the value of the auto_increment field. 
    It will generate a sequence number and then replace the value, if its value is NULL or empty.
    if the field's value is 0, the store engine will do like encountering the NULL values 
    unless NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.
    In contrast, if the field's value is 0, Store engine of slave always generates a new sequence number 
    whether or not NO_AUTO_VALUE_ON_ZERO is set into SQL_MODE.
    
    SQL MODE of slave sql thread is always consistency with master's.
    Another variable is related to this bug.
    If generateing a sequence number is decided by the values of
    table->auto_increment_field_not_null and SQL_MODE(if includes MODE_NO_AUTO_VALUE_ON_ZERO)
    The table->auto_increment_is_not_null is FALSE, which causes this bug to appear. ..
    df67d149
rpl_auto_increment.test 6.89 KB