Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            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 ... ]
            
            Show
            serg Sergei Golubchik added a comment - 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 ... ]

              People

              • Assignee:
                Unassigned
                Reporter:
                belugabehr BELUGABEHR
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: