Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.4, 11.8, 12.3, 13.0, 13.1
-
None
-
Can result in unexpected behaviour
Description
ALTER TABLE ... ENGINE=InnoDB on a DuckDB table with duplicate PRIMARY KEY values reports the wrong duplicate value in ER_DUP_ENTRY. This is misleading for users trying to identify and fix the actual duplicate before converting the table. Similar issue was already fixed for MyISAM in MDEV-23507
Test case
INSTALL SONAME 'ha_duckdb';
|
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=DuckDB;
|
INSERT INTO t1 VALUES (1),(1),(2),(3);
|
ALTER TABLE t1 ENGINE=InnoDB;
|
CLI Output
13.1.0-opt>INSTALL SONAME 'ha_duckdb';
|
Query OK, 0 rows affected (0.000 sec)
|
|
|
13.1.0-opt>CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=DuckDB;
|
Query OK, 0 rows affected (0.014 sec)
|
|
|
13.1.0-opt>INSERT INTO t1 VALUES (1),(1),(2),(3);
|
Query OK, 4 rows affected (0.004 sec)
|
Records: 4 Duplicates: 0 Warnings: 0
|
|
|
13.1.0-opt>ALTER TABLE t1 ENGINE=InnoDB;
|
ERROR 1062 (23000): Duplicate entry '3' for key 'PRIMARY'
|
13.1.0-opt>
|
Expected error
|
|
Expected: `ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY'`.
{noformat]
Attachments
Issue Links
- blocks
-
MDEV-40015 Transition DuckDB engine to gamma
-
- Open
-