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 # Test special cases of corrupt database handling in mmap-mode.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 set testprefix mmapcorrupt
19 database_may_be_corrupt
23 sqlite3_config_lookaside 0 0
28 PRAGMA page_size = 16384;
29 CREATE TABLE tn1(a PRIMARY KEY) WITHOUT ROWID;
30 CREATE TABLE t0(a PRIMARY KEY) WITHOUT ROWID;
31 CREATE TABLE t1(a PRIMARY KEY) WITHOUT ROWID;
32 INSERT INTO t1 VALUES('B');
36 set sz [file size test.db]
37 hexio_write test.db [expr $sz-3] 800380
41 PRAGMA mmap_size = 1000000;
42 SELECT sql FROM sqlite_schema LIMIT 1;
44 } {1000000 {CREATE TABLE tn1(a PRIMARY KEY) WITHOUT ROWID}}
47 INSERT INTO t0 SELECT * FROM t1;