mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-10 19:54:24 +01:00
Merge 'Test that DROP TABLE also deletes the related indices' from Anton Harniakou
These test were commented out, maybe they were written before CREATE INDEX was added. Closes #1437
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user