• sunny's avatar
    branches/5.1: This bug has always existed but was masked by other errors. The · 37a0550e
    sunny authored
    fix for bug# 38839 triggered this bug. When the offset and increment are > 1
    we need to calculate the next value taking into consideration the two
    variables. Previously we simply assumed they were 1 particularly offset was
    never used. MySQL does its own calculation and that's probably why it seemed
    to work in the past. We would return what we thought was the correct next
    value and then MySQL would recalculate the actual value from that and return
    it to the caller (e.g., handler::write_row()). Several new tests have been
    added that try and catch some edge cases. The tests exposed a wrap around
    error in MySQL next value calculation which was filed as bug#39828. The tests
    will need to be updated once MySQL fix that bug.
    
    One good side effect of this fix is that dict_table_t size has been
    reduced by 8 bytes because we have moved the autoinc_increment field to
    the row_prebuilt_t structure. See review-board for a detailed discussion.
    
    rb://3
    37a0550e
innodb-autoinc.test 12.6 KB