mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Fixed some TCL test cases to work if SQLITE_OMIT_TRIGGER is defined.
FossilOrigin-Name: 85e3c73497d72d09becf728efe81041277ca1730
This commit is contained in:
@ -960,15 +960,19 @@ proc copy_file {from to} {
|
||||
|
||||
# Drop all tables in database [db]
|
||||
proc drop_all_tables {{db db}} {
|
||||
set pk [$db one "PRAGMA foreign_keys"]
|
||||
$db eval "PRAGMA foreign_keys = OFF"
|
||||
ifcapable trigger&&foreignkey {
|
||||
set pk [$db one "PRAGMA foreign_keys"]
|
||||
$db eval "PRAGMA foreign_keys = OFF"
|
||||
}
|
||||
foreach {t type} [$db eval {
|
||||
SELECT name, type FROM sqlite_master
|
||||
WHERE type IN('table', 'view') AND name NOT like 'sqlite_%'
|
||||
}] {
|
||||
$db eval "DROP $type $t"
|
||||
}
|
||||
$db eval " PRAGMA foreign_keys = $pk "
|
||||
ifcapable trigger&&foreignkey {
|
||||
$db eval "PRAGMA foreign_keys = $pk"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user