• Sunny Bains's avatar
    Fix bug# 18274 InnoDB auto_increment field reset on OPTIMIZE TABLE · 239ca600
    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.
    239ca600
ha_innodb.cc 320 KB