Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.1, 10.2, 10.3, 10.4, 10.5
-
None
Description
I am keeping it as Major, despite it being "just" a wrong error message, because it can be important for problem diagnostics on users' side. From time to time we receive complaints of the kind "I got the error 'Duplicate key xx', but there is no duplicate xx in my table" (in various circumstances). It is difficult to investigate such problems as the real data can be dynamic, so we often consider it a user error. But it turns out the error message can be simply wrong.
--source include/have_sequence.inc
|
|
CREATE TABLE t1 (a INT) ENGINE=MyISAM; |
|
INSERT INTO t1 VALUES (8); |
INSERT INTO t1 SELECT seq FROM seq_1_to_100; |
|
--error ER_DUP_ENTRY
|
ALTER TABLE t1 ADD UNIQUE (a); |
|
# Cleanup
|
DROP TABLE t1; |
10.2 3e617b8b |
MariaDB [test]> ALTER TABLE t1 ADD UNIQUE (a); |
ERROR 1062 (23000): Duplicate entry '100' for key 'a' |
The error ER_DUP_ENTRY itself isn't wrong, there is a duplicate entry in there; but it's not 100, it is 8.
Also reproducible with Aria.
Attachments
Issue Links
- is duplicated by
-
MDEV-25741 Wrong warning on duplicate keys
- Closed