aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test85
1 files changed, 85 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test b/libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test
new file mode 100644
index 0000000..31b698c
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/tkt1667.test
@@ -0,0 +1,85 @@
1# 2006 February 10
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.
12#
13# This file implements tests to verify that ticket #1667 has been
14# fixed.
15#
16#
17# $Id: tkt1667.test,v 1.2 2006/06/20 11:01:09 danielk1977 Exp $
18
19set testdir [file dirname $argv0]
20source $testdir/tester.tcl
21
22ifcapable !autovacuum||!tclvar {
23 finish_test
24 return
25}
26
27db close
28file delete -force test.db test.db-journal
29
30# Set the pending byte offset such that the page it is on is
31# the first autovacuum pointer map page in the file (assume a page
32# size of 1024).
33
34set first_ptrmap_page [expr 1024/5 + 3]
35set sqlite_pending_byte [expr 1024 * ($first_ptrmap_page-1)]
36
37sqlite db test.db
38
39do_test tkt1667-1 {
40 execsql {
41 PRAGMA auto_vacuum = 1;
42 BEGIN;
43 CREATE TABLE t1(a, b);
44 }
45 for {set i 0} {$i < 500} {incr i} {
46 execsql {
47 INSERT INTO t1 VALUES($i, randstr(1000, 2000))
48 }
49 }
50 execsql {
51 COMMIT;
52 }
53} {}
54for {set i 0} {$i < 500} {incr i} {
55 do_test tkt1667-2.$i.1 {
56 execsql {
57 DELETE FROM t1 WHERE a = $i;
58 }
59 } {}
60 integrity_check tkt1667-2.$i.2
61}
62
63do_test tkt1667-3 {
64 execsql {
65 BEGIN;
66 }
67 for {set i 0} {$i < 500} {incr i} {
68 execsql {
69 INSERT INTO t1 VALUES($i, randstr(1000, 2000))
70 }
71 }
72 execsql {
73 COMMIT;
74 }
75} {}
76do_test tkt1667-4.1 {
77 execsql {
78 DELETE FROM t1;
79 }
80} {}
81integrity_check tkt1667-4.2
82
83finish_test
84
85