If you alter a table to add an index, what could happen if that thread was killed during processing?
Accroding to MySQL:
During ALTER TABLE, the kill flag is checked before each block of rows are read from the original table. If the kill flag was set, the statement is aborted and the temporary table is deleted.
Edit: Just making sure that it's not going to cause any additional issues.
What is unclear about that?
MySQL creates a temporay table with the new data structure, copies the data from the original table and when everything is finished, use the temp table as primary one.
If this fails at any step (possibly due to the abortion of the
ALTER TABLE
statement), the temporary table gets deleted and nothing happens.