Skip to content

Commit eb6639c

Browse files
committed
add test for VACUUM INTO
1 parent c22eaf8 commit eb6639c

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

test/sqlcipher-compatibility.test

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ file delete -force test2.db
553553
# then delete it and run a manual vacuum
554554
# verify that the file has become smaller
555555
# but can still be opened with the proper
556-
# key
556+
# key. also test vacuum into functionality introduced
557+
# in sqlite 3.27.1
557558
do_test vacuum {
558559
sqlite_orig db test.db
559560
set rc {}
@@ -579,27 +580,39 @@ do_test vacuum {
579580

580581
execsql {
581582
DELETE FROM t1 WHERE rowid > 5000;
583+
VACUUM into 'test-vacuum.db';
582584
VACUUM;
583585
}
584586
db close
585587

586-
# grab new file size, post
587-
# autovacuum
588-
set sz2 [file size test.db]
588+
# grab separate vacuum file size
589+
set sz2 [file size test-vacuum.db]
590+
591+
# grab test.db file size, post vacuum
592+
set sz3 [file size test.db]
589593

590594
# verify that the new size is
591595
# smaller than the old size
592596
if {$sz > $sz2} { lappend rc true }
597+
if {$sz > $sz3} { lappend rc true }
598+
599+
sqlite_orig db test-vacuum.db
600+
lappend rc [execsql {
601+
PRAGMA key = 'testkey';
602+
SELECT count(*) FROM t1;
603+
}]
604+
db close
593605

594606
sqlite_orig db test.db
595607
lappend rc [execsql {
596608
PRAGMA key = 'testkey';
597609
SELECT count(*) FROM t1;
598610
}]
599611

600-
} {10000 true 5000}
612+
} {10000 true true 5000 5000}
601613
db close
602614
file delete -force test.db
615+
file delete -force test-vacuum.db
603616

604617
# open a 1.1.8 database (no HMAC, 4K iter), then
605618
# try to open another 1.1.8 database. The

0 commit comments

Comments
 (0)