Index: third_party/sqlite/src/test/vacuum.test |
diff --git a/third_party/sqlite/src/test/vacuum.test b/third_party/sqlite/src/test/vacuum.test |
index 4b1cd5a3e60366f41bbbaad282920e94d1dd3171..34be57ce7c8c3261c52c8f565c13127698304630 100644 |
--- a/third_party/sqlite/src/test/vacuum.test |
+++ b/third_party/sqlite/src/test/vacuum.test |
@@ -54,6 +54,19 @@ do_test vacuum-1.1 { |
set ::cksum [cksum] |
expr {$::cksum!=""} |
} {1} |
+ |
+# Create bogus application-defined functions for functions used |
+# internally by VACUUM, to ensure that VACUUM falls back |
+# to the built-in functions. |
+# |
+proc failing_app_func {args} {error "bad function"} |
+do_test vacuum-1.1b { |
+ db func substr failing_app_func |
+ db func like failing_app_func |
+ db func quote failing_app_func |
+ catchsql {SELECT substr(name,1,3) FROM sqlite_master} |
+} {1 {bad function}} |
+ |
do_test vacuum-1.2 { |
execsql { |
VACUUM; |
@@ -287,14 +300,38 @@ do_test vacuum-7.0 { |
CREATE TABLE t1(t); |
VACUUM; |
} db2 |
+} {} |
+do_test vacuum-7.1 { |
execsql { |
CREATE TABLE t2(t); |
CREATE TABLE t3(t); |
DROP TABLE t2; |
+ PRAGMA freelist_count; |
+ } |
+} {1} |
+do_test vacuum-7.2 { |
+ execsql { |
VACUUM; |
pragma integrity_check; |
} db2 |
} {ok} |
+do_test vacuum-7.3 { |
+ execsql { PRAGMA freelist_count; } db2 |
+} {0} |
+ifcapable autovacuum { |
+ do_test vacuum-7.4 { |
+ execsql { PRAGMA auto_vacuum } db2 |
+ } {0} |
+ do_test vacuum-7.5 { |
+ execsql { PRAGMA auto_vacuum = 1} db2 |
+ execsql { PRAGMA auto_vacuum } db2 |
+ } {0} |
+ do_test vacuum-7.6 { |
+ execsql { PRAGMA auto_vacuum = 1} db2 |
+ execsql { VACUUM } db2 |
+ execsql { PRAGMA auto_vacuum } db2 |
+ } {1} |
+} |
db2 close |
# Ticket #873. VACUUM a database that has ' in its name. |