/ Check-in [c8893310]
Login

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

Overview
Comment:Run trans.test and avtrans.test as part of the "wal" permutation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: c8893310510148f7e71ede5691606b6fc1c3df4d
User & Date: dan 2010-04-27 06:49:34
Context
2010-04-27
14:37
Fix a problem with identifying a corrupt database in WAL mode. check-in: c8658da4 user: dan tags: wal
11:49
Add the xShmRelease() method to the VFS. The os_unix.c implementation of the shared memory logic is still non-functional. check-in: ed715b47 user: drh tags: wal
06:49
Run trans.test and avtrans.test as part of the "wal" permutation. check-in: c8893310 user: dan tags: wal
05:42
Fix a problem that occurs when one process causes the log-summary file to grow and then a second process attempts to read the database. check-in: b51a5f8b user: dan tags: wal
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/avtrans.test.

    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   
    21     21   
    22     22   # Create several tables to work with.
    23     23   #
    24     24   do_test avtrans-1.0 {
    25         -  execsql {
    26         -    PRAGMA auto_vacuum=ON;
           25  +  execsql { PRAGMA auto_vacuum=ON }
           26  +  wal_set_journal_mode
           27  +  execsql { 
    27     28       CREATE TABLE one(a int PRIMARY KEY, b text);
    28     29       INSERT INTO one VALUES(1,'one');
    29     30       INSERT INTO one VALUES(2,'two');
    30     31       INSERT INTO one VALUES(3,'three');
    31     32       SELECT b FROM one ORDER BY a;
    32     33     }
    33     34   } {one two three}
................................................................................
    44     45     sqlite3 altdb test.db
    45     46     execsql {SELECT b FROM one ORDER BY a} altdb
    46     47   } {one two three}
    47     48   do_test avtrans-1.10 {
    48     49     execsql {SELECT b FROM two ORDER BY a} altdb
    49     50   } {I V X}
    50     51   integrity_check avtrans-1.11
           52  +wal_check_journal_mode avtrans-1.12
    51     53   
    52     54   # Basic transactions
    53     55   #
    54     56   do_test avtrans-2.1 {
    55     57     set v [catch {execsql {BEGIN}} msg]
    56     58     lappend v $msg
    57     59   } {0 {}}
................................................................................
    80     82       BEGIN;
    81     83       SELECT a FROM one ORDER BY a;
    82     84       SELECT a FROM two ORDER BY a;
    83     85       END;
    84     86     }
    85     87   } {1 2 3 1 5 10}
    86     88   integrity_check avtrans-2.11
           89  +wal_check_journal_mode avtrans-2.12
    87     90   
    88     91   # Check the locking behavior
    89     92   #
    90     93   sqlite3_soft_heap_limit 0
    91     94   do_test avtrans-3.1 {
    92     95     execsql {
    93     96       BEGIN;
................................................................................
   909    912           } [expr {$i%2==0}]
   910    913         } else {
   911    914           do_test avtrans-9.$i.5-$cnt {
   912    915              expr {$sqlite_fullsync_count==0}
   913    916           } {1}
   914    917         }
   915    918       }
          919  +    wal_check_journal_mode avtrans-9.$i-6.$cnt
   916    920     }
   917    921     set ::pager_old_format 0
   918    922   }
   919    923   integrity_check avtrans-10.1
          924  +wal_check_journal_mode avtrans-10.2
   920    925      
   921    926   finish_test

Changes to test/permutations.test.

   759    759   run_tests "wal" -description {
   760    760     Run tests with journal_mode=WAL
   761    761   } -initialize {
   762    762     set ::savepoint6_iterations 100
   763    763   } -shutdown {
   764    764     unset -nocomplain ::savepoint6_iterations
   765    765   } -include {
   766         -  savepoint.test
   767         -  savepoint2.test
   768         -  savepoint6.test
          766  +  savepoint.test     savepoint2.test     savepoint6.test
          767  +  trans.test         avtrans.test
   769    768   }
   770    769   
   771    770   # End of tests
   772    771   #############################################################################
   773    772   
   774    773   if {$::perm::testmode eq "targets"} { puts "" ; exit }
   775    774   

Changes to test/trans.test.

    15     15   
    16     16   
    17     17   set testdir [file dirname $argv0]
    18     18   source $testdir/tester.tcl
    19     19   
    20     20   # Create several tables to work with.
    21     21   #
           22  +wal_set_journal_mode
    22     23   do_test trans-1.0 {
    23     24     execsql {
    24     25       CREATE TABLE one(a int PRIMARY KEY, b text);
    25     26       INSERT INTO one VALUES(1,'one');
    26     27       INSERT INTO one VALUES(2,'two');
    27     28       INSERT INTO one VALUES(3,'three');
    28     29       SELECT b FROM one ORDER BY a;
................................................................................
    42     43     sqlite3 altdb test.db
    43     44     execsql {SELECT b FROM one ORDER BY a} altdb
    44     45   } {one two three}
    45     46   do_test trans-1.10 {
    46     47     execsql {SELECT b FROM two ORDER BY a} altdb
    47     48   } {I V X}
    48     49   integrity_check trans-1.11
           50  +wal_check_journal_mode trans-1.12
    49     51   
    50     52   # Basic transactions
    51     53   #
    52     54   do_test trans-2.1 {
    53     55     set v [catch {execsql {BEGIN}} msg]
    54     56     lappend v $msg
    55     57   } {0 {}}
................................................................................
    78     80       BEGIN;
    79     81       SELECT a FROM one ORDER BY a;
    80     82       SELECT a FROM two ORDER BY a;
    81     83       END;
    82     84     }
    83     85   } {1 2 3 1 5 10}
    84     86   integrity_check trans-2.11
           87  +wal_check_journal_mode trans-2.12
    85     88   
    86     89   # Check the locking behavior
    87     90   #
    88     91   do_test trans-3.1 {
    89     92     execsql {
    90     93       BEGIN;
    91     94       UPDATE one SET a = 0 WHERE 0;
................................................................................
   158    161   do_test trans-3.14 {
   159    162     set v [catch {execsql {
   160    163       SELECT a FROM one ORDER BY a;
   161    164     } db} msg]
   162    165     lappend v $msg
   163    166   } {0 {1 2 3 4}}
   164    167   integrity_check trans-3.15
          168  +wal_check_journal_mode trans-3.16
   165    169   
   166    170   do_test trans-4.1 {
   167    171     set v [catch {execsql {
   168    172       COMMIT;
   169    173     } db} msg]
   170    174     lappend v $msg
   171    175   } {1 {cannot commit - no transaction is active}}
................................................................................
   224    228   do_test trans-4.11 {
   225    229     set v [catch {execsql {
   226    230       SELECT a FROM one ORDER BY a;
   227    231     } altdb} msg]
   228    232     lappend v $msg
   229    233   } {0 {1 2 3 4}}
   230    234   integrity_check trans-4.12
          235  +wal_check_journal_mode trans-4.13
          236  +wal_check_journal_mode trans-4.14 altdb
   231    237   do_test trans-4.98 {
   232    238     altdb close
   233    239     execsql {
   234    240       DROP TABLE one;
   235    241       DROP TABLE two;
   236    242     }
   237    243   } {}
................................................................................
   771    777       }
   772    778     } $checksum
   773    779   }
   774    780   do_test trans-7.14 {
   775    781     execsql {SELECT md5sum(type,name,tbl_name,rootpage,sql) FROM sqlite_master}
   776    782   } $checksum2
   777    783   integrity_check trans-7.15
          784  +wal_check_journal_mode trans-7.16
   778    785   
   779    786   # Arrange for another process to begin modifying the database but abort
   780    787   # and die in the middle of the modification.  Then have this process read
   781    788   # the database.  This process should detect the journal file and roll it
   782    789   # back.  Verify that this happens correctly.
   783    790   #
   784    791   set fd [open test.tcl w]
................................................................................
   820    827     catch {exec [info nameofexec] test.tcl}
   821    828     execsql {SELECT md5sum(x,y,z) FROM t2}
   822    829   } $checksum
   823    830   do_test trans-8.5 {
   824    831     execsql {SELECT md5sum(type,name,tbl_name,rootpage,sql) FROM sqlite_master}
   825    832   } $checksum2
   826    833   integrity_check trans-8.6
   827         -
          834  +wal_check_journal_mode trans-8.7
   828    835   
   829    836   # In the following sequence of tests, compute the MD5 sum of the content
   830    837   # of a table, make lots of modifications to that table, then do a rollback.
   831    838   # Verify that after the rollback, the MD5 checksum is unchanged.
   832    839   #
   833    840   do_test trans-9.1 {
   834    841     execsql {
................................................................................
   850    857       INSERT INTO t3 SELECT randstr(10,400) FROM t3;
   851    858       INSERT INTO t3 SELECT randstr(10,400) FROM t3;
   852    859       INSERT INTO t3 SELECT randstr(10,400) FROM t3;
   853    860       COMMIT;
   854    861       SELECT count(*) FROM t3;
   855    862     }
   856    863   } {1024}
          864  +wal_check_journal_mode trans-9.1.1
   857    865   
   858    866   # The following procedure computes a "signature" for table "t3".  If
   859    867   # T3 changes in any way, the signature should change.  
   860    868   #
   861    869   # This is used to test ROLLBACK.  We gather a signature for t3, then
   862    870   # make lots of changes to t3, then rollback and take another signature.
   863    871   # The two signatures should be the same.
................................................................................
   936    944         } else {
   937    945           do_test trans-9.$i.5-$cnt {
   938    946             expr {$sqlite_fullsync_count==0}
   939    947           } {1}
   940    948         }
   941    949       }
   942    950     }
          951  +
          952  +  wal_check_journal_mode trans-9.$i.6-$cnt
   943    953     set ::pager_old_format 0
   944    954   }
   945    955      
   946    956   finish_test