diff --git a/testing/drop_index.test b/testing/drop_index.test index 4edbfc2bc..7ddc21a45 100755 --- a/testing/drop_index.test +++ b/testing/drop_index.test @@ -44,3 +44,15 @@ do_execsql_test_on_specific_db {:memory:} drop-index-after-ops-1 { DROP INDEX t_idx6; SELECT count(*) FROM sqlite_schema WHERE type='index' AND name='t_idx6'; } {0} + +# Test dropping of indices associated with unique or primary contraint indices produces an error +do_execsql_test_in_memory_error_content drop-index-primary-key-index { + CREATE TABLE t15a (id TEXT PRIMARY KEY ); + DROP INDEX sqlite_autoindex_t15a_1; +} {"index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped"} + + +do_execsql_test_in_memory_error_content drop-index-unique-index { + CREATE TABLE t15b (id INT UNIQUE ); + DROP INDEX sqlite_autoindex_t15b_1; +} {"index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped"} \ No newline at end of file