• istruewing@stella.local's avatar
    Bug#4692 - DISABLE/ENABLE KEYS waste a space · 30b409bd
    istruewing@stella.local authored
    Disabling and enabling indexes on a non-empty table grows the
    index file.
    
    Disabling indexes just sets a flag per non-unique index and does not
    free the index blocks of the affected indexes. Re-enabling indexes
    creates new indexes with new blocks. The old blocks remain unused
    in the index file.
    
    Fixed by dropping and re-creating all indexes if non-empty disabled
    indexes exist when enabling indexes. Dropping all indexes resets
    the internal end-of-file marker to the end of the index file header.
    It also clears the root block pointers of every index and clears the
    deleted blocks chains. This way all blocks are declared as free.
    30b409bd
myisam.test 48.2 KB