• Satya B's avatar
    BUG#40827 - Killing insert-select to MyISAM can cause table corruption · f6c28cd9
    Satya B authored
                      
    Killing insert-select statement on MyISAM corrupts the table.
                      
    Killing the insert-select statement corrupts the MyISAM table only
    when the destination table is empty and when it has indexes. When 
    we bulk insert huge data and if the destination table is empty we 
    disable the indexes for fast inserts, data is then inserted and 
    indexes are re-enabled after bulk_insert operation
                      
    Killing the query, aborts the repair table operation during enable
    indexes phase leading to table corruption.
                    
    We now truncate the table when we detect that enable indexes is
    killed for bulk insert query.As we have an empty table before the 
    operation, we can fix by truncating the table.
    f6c28cd9
ha_myisam.cc 67.9 KB