Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3841 LevelDB storage engine
  3. MDEV-4043

LevelDB (Feature request): Produce ER_DUP_ENTRY instead of ER_DUP_KEY

    XMLWordPrintable

Details

    • Technical task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      There are two similar errors, ER_DUP_ENTRY and ER_DUP_KEY; all in all, ER_DUP_ENTRY probably provides more useful information (the name of the key and the offending value vs the table name):

      perror 1062
      MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
      perror 1022
      MySQL error code 1022 (ER_DUP_KEY): Can't write; duplicate key in table '%-.192s'

      CREATE TABLE t1 (i INT PRIMARY KEY) ENGINE=InnoDB;
      INSERT INTO t1 VALUES (1),(2),(3);
      INSERT INTO t1 VALUES (4),(2),(5);
      ERROR 23000: Duplicate entry '2' for key 'PRIMARY'

      CREATE TABLE t1 (i INT PRIMARY KEY) ENGINE=LevelDB;
      INSERT INTO t1 VALUES (1),(2),(3);
      INSERT INTO t1 VALUES (4),(2),(5);
      ERROR 23000: Can't write; duplicate key in table 't1'

      So if it's possible, it might make sense to produce ER_DUP_ENTRY on a duplicate key error.

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.