Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5168

MariaDB returns warnings for INSERT IGNORE

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.4, 5.5.33
    • Fix Version/s: 5.5.35
    • Component/s: None
    • Labels:
      None

      Description

      In MariaDB 5.5.28 (and merged into 10.0.0) the following change was made by Monty:

      http://bazaar.launchpad.net/~maria-captains/maria/10.0-base/revision/3413.16.2#sql/sql_insert.cc

      This causes warnings to be emitted by INSERT IGNORE, which differs from MySQL behavior and specifically contradicts the documentation for INSERT IGNORE which says:

      http://dev.mysql.com/doc/refman/5.5/en/insert.html

      "If you use the IGNORE keyword, errors that occur while executing the INSERT statement are ignored. For example, without IGNORE, a row that duplicates an existing UNIQUE index or PRIMARY KEY value in the table causes a duplicate-key error and the statement is aborted. With IGNORE, the row still is not inserted, but no error occurs. Ignored errors may generate warnings instead, although duplicate-key errors do not."

      The MariaDB page on IGNORE doesn't mention this difference:

      https://mariadb.com/kb/en/ignore/

      This new behavior is not actually desired and causes incompatibilities in some cases (e.g. clients who use INSERT IGNORE and actually check warnings). This should have been gated behind a SQL_MODE at least.

      Is there any chance this change could be reverted or corrected?

        Attachments

          Activity

            People

            • Assignee:
              monty Michael Widenius
              Reporter:
              jeremycole Jeremy Cole
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: