LevelDB storage engine (MDEV-3841)

[MDEV-4043] LevelDB (Feature request): Produce ER_DUP_ENTRY instead of ER_DUP_KEY Created: 2013-01-15  Updated: 2013-01-15  Resolved: 2013-01-15

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Technical task Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: leveldb

Issue Links:
Relates

 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.



 Comments   
Comment by Sergei Petrunia [ 2013-01-15 ]

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.

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