Description
DROP INDEX rejects every index flagged as UNIQUE, including user-created CREATE UNIQUE INDEX indexes. SQLite only rejects dropping the auto-created sqlite_autoindex_* indexes that back table-level UNIQUE/PRIMARY KEY constraints.
Reproducer
CREATE TABLE t(a INTEGER PRIMARY KEY, b TEXT);
CREATE UNIQUE INDEX ux_t_ab ON t(a, b);
DROP INDEX ux_t_ab;
-- Turso: × Invalid argument supplied: index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped
-- SQLite: (drops the index cleanly)
Per SQLite documentation: "The DROP INDEX statement removes an index added with the CREATE INDEX statement. The index is completely removed from the disk. The only way to recover the index is to reenter the appropriate CREATE INDEX command."
core/translate/index.rs:942-950 - The DROP INDEX validation rejects any index where idx.unique is true, without distinguishing user-created unique indexes from auto-created sqlite_autoindex_* indexes that back table constraints. The existing testing/sqltests/tests/drop_index.sqltest tests only cover the auto-index case, so the regression slipped through.
This issue brought to you by Mikaël and Claude Code.
Description
DROP INDEXrejects every index flagged asUNIQUE, including user-createdCREATE UNIQUE INDEXindexes. SQLite only rejects dropping the auto-createdsqlite_autoindex_*indexes that back table-levelUNIQUE/PRIMARY KEYconstraints.Reproducer
Per SQLite documentation: "The DROP INDEX statement removes an index added with the CREATE INDEX statement. The index is completely removed from the disk. The only way to recover the index is to reenter the appropriate CREATE INDEX command."
core/translate/index.rs:942-950- The DROP INDEX validation rejects any index whereidx.uniqueis true, without distinguishing user-created unique indexes from auto-createdsqlite_autoindex_*indexes that back table constraints. The existingtesting/sqltests/tests/drop_index.sqltesttests only cover the auto-index case, so the regression slipped through.This issue brought to you by Mikaël and Claude Code.