1
0
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:
shaneh
2009-12-17 22:12:51 +00:00
parent ca7dfda1d4
commit 4e7b32f37f
4 changed files with 26 additions and 20 deletions

View File

@ -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"
}
}