• Nisha Gopalakrishnan's avatar
    BUG#18618561: FAILED ALTER TABLE ENGINE CHANGE WITH PARTITIONS · 24756e8e
    Nisha Gopalakrishnan authored
                  CORRUPTS FRM
    
    Analysis:
    ---------
    ALTER TABLE on a partitioned table resulted in the wrong
    engine being written into the table's FRM file and displayed
    in SHOW CREATE TABLE.
    
    The prep_alter_part_table() modifies the partition_info object
    for TABLE instance representing the old version of table.
    If the ALTER TABLE ENGINE statement fails, the partition_info
    object for the TABLE contains the altered storage engine name.
    The SHOW CREATE TABLE uses the TABLE object to display the table
    information, hence displays incorrect storage engine for the table.
    Also a subsequent successful ALTER TABLE operation will write the
    incorrect engine information into the FRM file.
    
    Fix:
    ---
    A copy of the partition_info object is created before modification so
    that any changes would not cause the the original partition_info object
    to be modified if the ALTER TABLE fails.(Backported part of the code
    provided as fix for bug#14156617 in mysql-5.6.6).
    24756e8e
partition_archive.result 4.53 KB