/ Check-in [48d736c0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a couple of problems with new test scripts causing the permutations test to fail.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:48d736c0ee1ac0879bd12d2f1901f208e87e538a
User & Date: dan 2014-01-27 16:35:15
Context
2014-01-28
17:49
Minor bugfix in main.c so that the library builds with SQLITE_OMIT_WSD defined. check-in: 5e3b9ecc user: dan tags: trunk
2014-01-27
16:35
Fix a couple of problems with new test scripts causing the permutations test to fail. check-in: 48d736c0 user: dan tags: trunk
15:02
Update some requirements marks to conform with improvements in the documentation. check-in: be1acb61 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/corruptH.test.

    92     92     hexio_write test.db [expr {($fl-1) * 1024 + 4}] 00000001 
    93     93     hexio_write test.db [expr {($fl-1) * 1024 + 8}] [format %.8X $r(t1)]
    94     94     hexio_write test.db 36 00000002
    95     95   
    96     96     sqlite3 db test.db
    97     97   } {}
    98     98   
           99  +
          100  +# The corruption migration caused by the test case below does not 
          101  +# cause corruption to be detected in mmap mode.
          102  +#
          103  +# The trick here is that the root page of the tree scanned by the outer 
          104  +# query is also currently on the free-list. So while the first seek on
          105  +# the table (for a==1) works, by the time the second is attempted The 
          106  +# "INSERT INTO t2..." statements have recycled the root page of t1 and
          107  +# used it as an index leaf. Normally, BtreeMovetoUnpacked() detects
          108  +# that the PgHdr object associated with said root page does not match
          109  +# the cursor (as it is now marked with PgHdr.intKey==0) and returns
          110  +# SQLITE_CORRUPT. 
          111  +#
          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  +set res23 {1 {database disk image is malformed}}
          118  +if {[permutation]=="mmap"} {
          119  +  set res23 {0 one}
          120  +}
    99    121   do_test 2.3 {
   100    122     list [catch {
          123  +  set res [list]
   101    124     db eval { SELECT * FROM t1 WHERE a IN (1, 2) } {
   102    125       db eval { 
   103    126         INSERT INTO t2 SELECT randomblob(100) FROM t2;
   104    127         INSERT INTO t2 SELECT randomblob(100) FROM t2;
   105    128         INSERT INTO t2 SELECT randomblob(100) FROM t2;
   106    129         INSERT INTO t2 SELECT randomblob(100) FROM t2;
   107    130         INSERT INTO t2 SELECT randomblob(100) FROM t2;
   108    131       }
          132  +    lappend res $b
   109    133     }
          134  +  set res
   110    135     } msg] $msg
   111         -} {1 {database disk image is malformed}}
          136  +} $res23
   112    137   
   113    138   #-------------------------------------------------------------------------
   114    139   reset_db
   115    140   
   116    141   # Initialize the database.
   117    142   #
   118    143   do_execsql_test 3.1 {

Changes to test/pager4.test.

     5      5   #
     6      6   #    May you do good and not evil.
     7      7   #    May you find forgiveness for yourself and forgive others.
     8      8   #    May you share freely, never taking more than you give.
     9      9   #
    10     10   #***********************************************************************
    11     11   #
    12         -# Tests for the SQLITE_IOERR_NODB error condition: the database file file
           12  +# Tests for the SQLITE_READONLY_DBMOVED error condition: the database file
    13     13   # is unlinked or renamed out from under SQLite.
    14     14   #
    15     15   
    16     16   if {$tcl_platform(platform)!="unix"} return
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +
           21  +if {[permutation]=="inmemory_journal"} {
           22  +  finish_test
           23  +  return
           24  +}
    20     25   
    21     26   # Create a database file for testing
    22     27   #
    23     28   do_execsql_test pager4-1.1 {
    24     29     CREATE TABLE t1(a,b,c);
    25     30     INSERT INTO t1 VALUES(673,'stone','philips');
    26     31     SELECT * FROM t1;