/ Check-in [97fcd9e8]
Login

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

Overview
Comment:Add another test for [2d1a5c67df].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 97fcd9e88891abd44037004e47862bcecfa1b0c9
User & Date: dan 2011-05-19 07:53:23
Context
2011-05-20
01:49
Mark an unreachable branch in the recent WAL problem as unreachable. check-in: 3e8a29ff user: drh tags: trunk
2011-05-19
07:53
Add another test for [2d1a5c67df]. check-in: 97fcd9e8 user: dan tags: trunk
01:21
When committing a WAL transaction, make sure at least one page is written to the WAL file so that the WAL subsystem will have a page on which to set the commit flag. Ticket [2d1a5c67dfc236]. check-in: 67bf1c9a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/tkt-2d1a5c67d.test.

    13     13   # been resolved.
    14     14   #
    15     15   # 
    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
           20  +set testprefix tkt-2d1a5c67d
    20     21   
    21     22   ifcapable !wal {finish_test; return}
    22     23   
    23     24   for {set ii 1} {$ii<=10} {incr ii} {
    24     25     do_test tkt-2d1a5c67d.1.$ii {
    25     26       db close
    26     27       forcedelete test.db test.db-wal
................................................................................
    65     66         INSERT INTO t1(a,b) VALUES(1,2);
    66     67         SELECT sum(length(y)) FROM t2;
    67     68         COMMIT;
    68     69         SELECT * FROM t1;
    69     70       }
    70     71     } {1000000 1 2}
    71     72   }
           73  +
           74  +db close
           75  +sqlite3 db test.db
           76  +
           77  +
           78  +do_execsql_test 3.1 {
           79  +  PRAGMA cache_size = 10;
           80  +  CREATE TABLE t3(a INTEGER PRIMARY KEY, b);
           81  +  CREATE TABLE t4(a);
           82  +}
           83  +
           84  +do_execsql_test 3.2 {
           85  +  INSERT INTO t3 VALUES(NULL, randomblob(500));
           86  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 2
           87  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 4
           88  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 8
           89  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 16
           90  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 32
           91  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 64
           92  +  INSERT INTO t3 SELECT NULL, b||b FROM t3;     -- 128
           93  +}
           94  +
           95  +do_execsql_test 3.3 {
           96  +  BEGIN;
           97  +    INSERT INTO t4 VALUES('xyz');
           98  +}
           99  +
          100  +do_test 3.4 {
          101  +  set blobs [list]
          102  +  for {set i 1} {$i<100} {incr i} {
          103  +    set b [db incrblob -readonly t3 b $i]
          104  +    read $b
          105  +    lappend blobs $b
          106  +  }
          107  +
          108  +  execsql COMMIT
          109  +  execsql { SELECT * FROM t4 WHERE a = 'xyz' }
          110  +} {xyz}
          111  +
          112  +do_test 3.5 {
          113  +  foreach b $blobs { close $b }
          114  +  execsql { SELECT * FROM t4 WHERE a = 'xyz' }
          115  +} {xyz}
          116  +
          117  +# Check that recovery works on the WAL file.
          118  +#
          119  +forcedelete test.db2-wal test.db2
          120  +do_test 3.6 {
          121  +  file copy test.db-wal test.db2-wal
          122  +  file copy test.db test.db2
          123  +  sqlite3 db2 test.db2
          124  +  execsql { SELECT * FROM t4 WHERE a = 'xyz' } db2
          125  +} {xyz}
    72    126   
    73    127   finish_test