dolt
dolt copied to clipboard
INSERT IGNORE INTO throws `duplicate unique key given` for keyless tables
The correct behavior for INSERT IGNORE INTO when a duplicate unique key is found is to skip the insert that caused the violation. Currently, inserts on a keyless table will always return an error regardless.
Repro:
> dolt sql -q "CREATE TABLE keyless (col1 int UNIQUE);"
> dolt sql -q "INSERT INTO keyless VALUES (1);"
> dolt sql -q "INSERT IGNORE INTO keyless VALUES (1);"
error executing query on line 1: Duplicate entry for key 'col1': duplicate unique key given: [1]
The keyless table editor does not return an error for a unique key violation when the row is inserted, but instead returns the error when it is closed.
It needs to return the error when the row is inserted in order for the INSERT IGNORE machinery in GMS to ignore the error correctly. Additionally, some work may be required to implement the associated required checkpointing functionality.
This is fixed in the new __DOLT_1__
format.
Gonna close as we have it working in the new format.