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

    Details

    • Type: Technical task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            psergey Sergei Petrunia added a comment -

            This automatically started to work when ON DUPLICATE KEY UPDATE part of Storage Engine interface was implemented. I think, it needed the storage engine to inform upper layer about which key had the unique-ness violation.

            Show
            psergey Sergei Petrunia added a comment - This automatically started to work when ON DUPLICATE KEY UPDATE part of Storage Engine interface was implemented. I think, it needed the storage engine to inform upper layer about which key had the unique-ness violation.

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: