Bug #89385 INSERT IGNORE DUPLICATE KEY
Submitted: 24 Jan 2018 15:14 Modified: 6 Oct 2020 13:05
Reporter: Victor Porton Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[24 Jan 2018 15:14] Victor Porton
Description:
I propose the following new syntax:

INSERT IGNORE DUPLICATE KEY ...

It would work as "INSERT IGNORE" but ignore ONLY "duplicate unique key" errors.

Rationale: INSERT IGNORE is most often used to ignore duplicate keys when inserting. Ignoring other errors is usually a bad side behavior. Usually non-duplicate-keys errors should NOT be ignored. So this feature is useful.

The same for REPLACE statement.

How to repeat:
Type

INSERT IGNORE DUPLICATE KEY ...

It won't work.
[6 Oct 2020 13:05] MySQL Verification Team
Hi Mr. Porton,

Thank you for your feature request.

However, you can efficiently workaround this problem with ........ ON DUPLICATE .... UPDATE and then set the assignment list conveniently.

Not a bug.