diff options
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/vacuum2.test')
-rw-r--r-- | libraries/sqlite/unix/sqlite-3.5.1/test/vacuum2.test | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/vacuum2.test b/libraries/sqlite/unix/sqlite-3.5.1/test/vacuum2.test new file mode 100644 index 0000000..5a6aca7 --- /dev/null +++ b/libraries/sqlite/unix/sqlite-3.5.1/test/vacuum2.test | |||
@@ -0,0 +1,60 @@ | |||
1 | # 2005 February 15 | ||
2 | # | ||
3 | # The author disclaims copyright to this source code. In place of | ||
4 | # a legal notice, here is a blessing: | ||
5 | # | ||
6 | # May you do good and not evil. | ||
7 | # May you find forgiveness for yourself and forgive others. | ||
8 | # May you share freely, never taking more than you give. | ||
9 | # | ||
10 | #*********************************************************************** | ||
11 | # This file implements regression tests for SQLite library. The | ||
12 | # focus of this file is testing the VACUUM statement. | ||
13 | # | ||
14 | # $Id: vacuum2.test,v 1.3 2007/07/19 16:35:17 drh Exp $ | ||
15 | |||
16 | set testdir [file dirname $argv0] | ||
17 | source $testdir/tester.tcl | ||
18 | |||
19 | # If the VACUUM statement is disabled in the current build, skip all | ||
20 | # the tests in this file. | ||
21 | # | ||
22 | ifcapable {!vacuum||!autoinc} { | ||
23 | finish_test | ||
24 | return | ||
25 | } | ||
26 | if $AUTOVACUUM { | ||
27 | finish_test | ||
28 | return | ||
29 | } | ||
30 | |||
31 | # Ticket #1121 - make sure vacuum works if all autoincrement tables | ||
32 | # have been deleted. | ||
33 | # | ||
34 | do_test vacuum2-1.1 { | ||
35 | execsql { | ||
36 | CREATE TABLE t1(x INTEGER PRIMARY KEY AUTOINCREMENT, y); | ||
37 | DROP TABLE t1; | ||
38 | VACUUM; | ||
39 | } | ||
40 | } {} | ||
41 | |||
42 | # Ticket #2518. Make sure vacuum increments the change counter | ||
43 | # in the database header. | ||
44 | # | ||
45 | do_test vacuum2-2.1 { | ||
46 | execsql { | ||
47 | CREATE TABLE t1(x); | ||
48 | CREATE TABLE t2(y); | ||
49 | INSERT INTO t1 VALUES(1); | ||
50 | } | ||
51 | hexio_get_int [hexio_read test.db 24 4] | ||
52 | } [expr {[hexio_get_int [hexio_read test.db 24 4]]+3}] | ||
53 | do_test vacuum2-2.1 { | ||
54 | execsql { | ||
55 | VACUUM | ||
56 | } | ||
57 | hexio_get_int [hexio_read test.db 24 4] | ||
58 | } [expr {[hexio_get_int [hexio_read test.db 24 4]]+1}] | ||
59 | |||
60 | finish_test | ||