From b6a5cbe6265a6e2070ff957b58d907a054a9329f Mon Sep 17 00:00:00 2001 From: Anton Harniakou Date: Sat, 3 May 2025 12:41:19 +0300 Subject: [PATCH] Test that DROP TABLE also deletes the related indices --- testing/drop_table.test | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/testing/drop_table.test b/testing/drop_table.test index c6daf04d4..e1c48ec0c 100755 --- a/testing/drop_table.test +++ b/testing/drop_table.test @@ -26,23 +26,23 @@ do_execsql_test_on_specific_db {:memory:} drop-table-if-exists-2 { } {success} # Test dropping table with index -#do_execsql_test_on_specific_db {:memory:} drop-table-with-index-1 { -# CREATE TABLE t3(x INTEGER PRIMARY KEY, y TEXT); -# CREATE INDEX idx_t3_y ON t3(y); -# INSERT INTO t3 VALUES(1, 'one'); -# DROP TABLE t3; -# SELECT count(*) FROM sqlite_schema WHERE tbl_name='t3'; -#} {0} +do_execsql_test_on_specific_db {:memory:} drop-table-with-index-1 { + CREATE TABLE t3(x INTEGER PRIMARY KEY, y TEXT); + CREATE INDEX idx_t3_y ON t3(y); + INSERT INTO t3 VALUES(1, 'one'); + DROP TABLE t3; + SELECT count(*) FROM sqlite_schema WHERE tbl_name='t3'; +} {0} # Test dropping table cleans up related schema entries -#do_execsql_test_on_specific_db {:memory:} drop-table-schema-cleanup-1 { -# CREATE TABLE t4(x INTEGER PRIMARY KEY, y TEXT); -# CREATE INDEX idx1_t4 ON t4(x); -# CREATE INDEX idx2_t4 ON t4(y); -# INSERT INTO t4 VALUES(1, 'one'); -# DROP TABLE t4; -# SELECT count(*) FROM sqlite_schema WHERE tbl_name='t4'; -#} {0} +do_execsql_test_on_specific_db {:memory:} drop-table-schema-cleanup-1 { + CREATE TABLE t4(x INTEGER PRIMARY KEY, y TEXT); + CREATE INDEX idx1_t4 ON t4(x); + CREATE INDEX idx2_t4 ON t4(y); + INSERT INTO t4 VALUES(1, 'one'); + DROP TABLE t4; + SELECT count(*) FROM sqlite_schema WHERE tbl_name='t4'; +} {0} # Test dropping table after multiple inserts and deletes do_execsql_test_on_specific_db {:memory:} drop-table-after-ops-1 {