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 #***********************************************************************
12 # $Id: tkt3918.test,v 1.1 2009/06/17 11:13:28 danielk1977 Exp $
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
19 PRAGMA page_size = 1024;
20 PRAGMA auto_vacuum = incremental;
21 CREATE TABLE t1(i, x);
26 INSERT INTO t1 VALUES(1, randstr(1000,1000));
27 INSERT INTO t1 VALUES(2, zeroblob(248*1020 + 100));
28 INSERT INTO t1 VALUES(3, zeroblob(2*1020 + 100));
32 # This set of statements sets up the free list so that the
33 # first free-list trunk page contains only a single leaf.
34 # The leaf page is also the last page in the database. The
35 # second free-list trunk page contains, amongst other things,
39 DELETE FROM t1 WHERE i = 2;
40 DELETE FROM t1 WHERE i = 1;
41 DELETE FROM t1 WHERE i = 3;
45 # Incrementally vacuum the database to reduce its size by a single
46 # page. This will remove the single leaf from the first page in
47 # the linked list of free-list trunk pages.
49 execsql { PRAGMA incremental_vacuum = 1 }
52 # Create another table. This operation will attempt to extract
53 # page 4 from the database free-list. Bug 3918 caused sqlite to
54 # incorrectly report corruption here.
56 execsql { CREATE TABLE t2(a, b) }