MySQL: ALTER IGNORE TABLE ADD UNIQUE, what will be truncated?

前端 未结 2 1755
感动是毒
感动是毒 2020-11-30 03:48

I have a table with 4 columns: ID, type, owner, description. ID is AUTO_INCREMENT PRIMARY KEY and now I want to:

ALTER IGNORE TABLE `my_table`
    ADD UNIQUE         


        
2条回答
  •  囚心锁ツ
    2020-11-30 04:47

    It appears that your problem is one of the very reasons that ALTER IGNORE has been deprecated.

    This is from the MySQL notes on the ALTER IGNORE deprecation:

    "This feature is badly defined (what is the first row?), causes problems for replication, disables online alter for unique index creation and has caused problems with foreign keys (rows removed in parent table)."

提交回复
热议问题