• Sunny Bains's avatar
    Fix bug# 18274 InnoDB auto_increment field reset on OPTIMIZE TABLE · 61c2b12d
    Sunny Bains authored
    OPTIMIZE TABLE recreates the whole table. That is why the counter gets reset.
    Making the next autoinc column persistent is a separate issue from resetting
    the value after an OPTIMIZE TABLE. We already have a check for ALTER TABLE
    and CREATE INDEX to preserve the value on table recreate. We should be able to
    add an additional check for OPTIMIZE TABLE to preserve the next value.
    
    rb://519 Approved by Jimmy Yang.
    61c2b12d
innodb-autoinc-18274.test 814 Bytes