Comment 1 for bug 1368244

Revision history for this message
Nilnandan Joshi (nilnandan-joshi) wrote : Re: Table deleted during alter with pt-online-schema-change

Hi, Let me describe here, how exactly pt-online-schema works.

"pt-online-schema-change works by creating an empty copy of the table to alter, modifying it as desired, and then copying rows from the original table into the new table. When the copy is complete, it moves away the original table and replaces it with the new one. By default, it also drops the original table."

In your case, you get error while rename new table to original table,
Error updating foreign key constraints: DBD::mysql::db do failed: Table './ims/feed_items' already exists [for Statement "RENAME TABLE `ims`.`_feed_items_new` TO `ims`.`feed_items`"]

So you must have table feed_items in the database. It should not dropped. Even you should also have table like _feed_items_new. I have noticed one more thing that even if you have given option --alter-foreign-keys-method auto it uses drop-swap.

Determining the method to update foreign keys...
  `ims`.`video_thumbs`: too many rows: 2236639; must use drop_swap
Drop-swapping tables...

Can you please check again and provide the exact test case that how exactly we can reproduce it?
MySQL error log and table structure will be helpful.