• Mattias Jonsson's avatar
    Bug#57778: failed primary key add to partitioned innodb table inconsistent and crashes · 6c2c6118
    Mattias Jonsson authored
    It was possible to issue an ALTER TABLE ADD PRIMARY KEY on
    an partitioned InnoDB table that failed and crashed the server.
    
    The problem was that it succeeded to create the PK on at least
    one partition, and then failed on a subsequent partition, due to
    duplicate key violation. Since the partitions that already had added
    the PK was not reverted all partitions was not consistent with the
    table definition, which caused the crash.
    
    The solution was to add a revert step to ha_partition::add_index()
    that dropped the index for the already succeeded partitions, on failure.
    6c2c6118
partition.test 58.3 KB