[MDEV-5751] INSERT ... ON DUPLICATE KEY IGNORE Created: 2014-02-27  Updated: 2015-11-17

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: BELUGABEHR Assignee: Unassigned
Resolution: Unresolved Votes: 3
Labels: None


 Description   

I would like to request the following feature:

INSERT ... ON DUPLICATE KEY IGNORE

This feature is to address the issue posted here of having to perform a null operation:
http://stackoverflow.com/questions/1361340/how-to-insert-if-not-exists-in-mysql

It would work much like INSERT IGNORE except that it would only ignore duplicate key errors, but support all other error types. This is contrary to INSERT IGNORE as it reports all other errors as warnings, according to the manual.



 Comments   
Comment by Sergei Golubchik [ 2014-02-27 ]

also, for consistency, we could have

INSERT ... ON DUPLICATE KEY REPLACE

Thus making the whole grammar to be

INSERT ... [ ON DUPLICATE KEY { IGNORE | REPLACE | UPDATE SET ... ]

Generated at Thu Feb 08 07:06:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.