1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add some tests of statements in foreignkeys.html.

FossilOrigin-Name: 8382867956caf20f62c46c15b456c1c16d0824fd
This commit is contained in:
dan
2009-10-07 18:41:19 +00:00
parent ed81bf6082
commit f589450dc9
8 changed files with 242 additions and 23 deletions

View File

@ -958,6 +958,20 @@ 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"
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 "
}
# If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
# to non-zero, then set the global variable $AUTOVACUUM to 1.
set AUTOVACUUM $sqlite_options(default_autovacuum)