Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Do not run corruptH.test in mmap mode. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c0d54b4e41cba84dc5934e0fcd03fe42 |
User & Date: | dan 2014-03-06 18:16:45 |
Context
2014-03-07
| ||
02:29 | Avoid calling sqlite3OsDelete() on a file that is open, since this causes Windows to run *very* slowly. Comes up on error recovery in journal_mode=PERSIST. check-in: fdc651e2ec user: mistachkin tags: trunk | |
2014-03-06
| ||
18:16 | Do not run corruptH.test in mmap mode. check-in: c0d54b4e41 user: dan tags: trunk | |
13:38 | Improved EXPLAIN indentation of a loop in the ANALYZE logic for STAT4. Mark the not-found jump of a seek operation in that loop as never taken. check-in: 0a4200f95c user: drh tags: trunk | |
Changes
Changes to test/corruptH.test.
15 15 set testprefix corruptH 16 16 17 17 # Do not use a codec for tests in this file, as the database file is 18 18 # manipulated directly using tcl scripts (using the [hexio_write] command). 19 19 # 20 20 do_not_use_codec 21 21 database_may_be_corrupt 22 + 23 +# The corruption migrations tested by the code in this file are not detected 24 +# mmap mode. 25 +# 26 +# The reason is that in mmap mode, the different queries may use different 27 +# PgHdr objects for the same page (same data, but different PgHdr container 28 +# objects). And so the corruption is not detected. 29 +# 30 +if {[permutation]=="mmap"} { 31 + finish_test 32 + return 33 +} 22 34 23 35 # Initialize the database. 24 36 # 25 37 do_execsql_test 1.1 { 26 38 PRAGMA page_size=1024; 27 39 28 40 CREATE TABLE t1(a INTEGER PRIMARY KEY, b); ................................................................................ 48 60 } 49 61 db close 50 62 hexio_write test.db [expr {($r(t2)-1)*1024 + 11}] [format %.2X $r(t1)] 51 63 sqlite3 db test.db 52 64 } {} 53 65 54 66 do_test 1.3 { 67 +breakpoint 55 68 db eval { PRAGMA secure_delete=1 } 56 69 list [catch { 57 70 db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { 58 71 db eval { DELETE FROM t2 } 59 72 } 60 73 } msg] $msg 61 74 } {1 {database disk image is malformed}} ................................................................................ 93 106 hexio_write test.db [expr {($fl-1) * 1024 + 8}] [format %.8X $r(t1)] 94 107 hexio_write test.db 36 00000002 95 108 96 109 sqlite3 db test.db 97 110 } {} 98 111 99 112 100 -# The corruption migration caused by the test case below does not 101 -# cause corruption to be detected in mmap mode. 102 -# 103 113 # The trick here is that the root page of the tree scanned by the outer 104 114 # query is also currently on the free-list. So while the first seek on 105 115 # the table (for a==1) works, by the time the second is attempted The 106 116 # "INSERT INTO t2..." statements have recycled the root page of t1 and 107 117 # used it as an index leaf. Normally, BtreeMovetoUnpacked() detects 108 118 # that the PgHdr object associated with said root page does not match 109 119 # the cursor (as it is now marked with PgHdr.intKey==0) and returns 110 120 # SQLITE_CORRUPT. 111 121 # 112 -# However, in mmap mode, the outer query and the inner queries use 113 -# different PgHdr objects (same data, but different PgHdr container 114 -# objects). And so the corruption is not detected. Instead, the second 115 -# seek fails to find anything and only a single row is returned. 116 -# 117 122 set res23 {1 {database disk image is malformed}} 118 -if {[permutation]=="mmap"} { 119 - set res23 {0 one} 120 -} 121 123 do_test 2.3 { 122 124 list [catch { 123 125 set res [list] 124 126 db eval { SELECT * FROM t1 WHERE a IN (1, 2) } { 125 127 db eval { 126 128 INSERT INTO t2 SELECT randomblob(100) FROM t2; 127 129 INSERT INTO t2 SELECT randomblob(100) FROM t2;