3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests to verify that ticket #1667 has been
17 # $Id: tkt1667.test,v 1.4 2009/02/05 17:00:54 drh Exp $
19 set testdir [file dirname $argv0]
20 source $testdir/tester.tcl
22 ifcapable !autovacuum||!tclvar {
28 forcedelete test.db test.db-journal
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
34 set first_ptrmap_page [expr 1024/5 + 3]
35 sqlite3_test_control_pending_byte [expr 1024 * ($first_ptrmap_page-1)]
41 PRAGMA auto_vacuum = 1;
43 CREATE TABLE t1(a, b);
45 for {set i 0} {$i < 500} {incr i} {
47 INSERT INTO t1 VALUES($i, randstr(1000, 2000))
54 for {set i 0} {$i < 500} {incr i} {
55 do_test tkt1667-2.$i.1 {
57 DELETE FROM t1 WHERE a = $i;
60 integrity_check tkt1667-2.$i.2
67 for {set i 0} {$i < 500} {incr i} {
69 INSERT INTO t1 VALUES($i, randstr(1000, 2000))
81 integrity_check tkt1667-4.2