/ Check-in [4894a5d2]
Login

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

Overview
Comment:Modify test_journal.c to work with pre-allocated databases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental
Files: files | file ages | folders
SHA1:4894a5d21044b169f412fef095e689cb8a8575dc
User & Date: dan 2010-08-06 09:43:04
Context
2010-08-06
12:00
Further updates to comments in pager.c. check-in: 5f4c17a3 user: dan tags: experimental
09:43
Modify test_journal.c to work with pre-allocated databases. check-in: 4894a5d2 user: dan tags: experimental
06:54
Fix a bug to do with deleting the journal file when exiting exclusive-locking mode. check-in: 6217b607 user: dan tags: experimental
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test_journal.c.

   375    375   
   376    376       stop_ioerr_simulation(&iSave, &iSave2);
   377    377   
   378    378       /* Read the database free-list. Add the page-number for each free-list
   379    379       ** leaf to the jt_file.pWritable bitvec.
   380    380       */
   381    381       rc = sqlite3OsRead(p, aData, pMain->nPagesize, 0);
          382  +    if( rc==SQLITE_OK ){
          383  +      u32 nDbsize = decodeUint32(&aData[28]);
          384  +      if( nDbsize>0 && memcmp(&aData[24], &aData[92], 4)==0 ){
          385  +        u32 iPg;
          386  +        for(iPg=nDbsize+1; iPg<=pMain->nPage; iPg++){
          387  +          sqlite3BitvecSet(pMain->pWritable, iPg);
          388  +        }
          389  +      }
          390  +    }
   382    391       iTrunk = decodeUint32(&aData[32]);
   383    392       while( rc==SQLITE_OK && iTrunk>0 ){
   384    393         u32 nLeaf;
   385    394         u32 iLeaf;
   386    395         sqlite3_int64 iOff = (iTrunk-1)*pMain->nPagesize;
   387    396         rc = sqlite3OsRead(p, aData, pMain->nPagesize, iOff);
   388    397         nLeaf = decodeUint32(&aData[4]);
................................................................................
   487    496     start_ioerr_simulation(iSave, iSave2);
   488    497     sqlite3_free(aPage);
   489    498     if( rc==SQLITE_IOERR_SHORT_READ ){
   490    499       rc = SQLITE_OK;
   491    500     }
   492    501     return rc;
   493    502   }
   494         -
   495    503   
   496    504   /*
   497    505   ** Write data to an jt-file.
   498    506   */
   499    507   static int jtWrite(
   500    508     sqlite3_file *pFile, 
   501    509     const void *zBuf, 

Changes to test/fallocate.test.

    64     64   do_test fallocate-1.8 { execsql { COMMIT } } {}
    65     65   
    66     66   
    67     67   #-------------------------------------------------------------------------
    68     68   # The following tests - fallocate-2.* - test that things work in WAL
    69     69   # mode as well.
    70     70   #
           71  +set skipwaltests [expr {[permutation]=="journaltest"}]
           72  +ifcapable !wal { set skipwaltests 1 }
           73  +
           74  +if {!$skipwaltests} {
    71     75   db close
    72     76   file delete -force test.db
    73     77   sqlite3 db test.db
    74     78   file_control_chunksize_test db main [expr 32*1024]
    75     79   
    76     80   do_test fallocate-2.1 {
    77     81     execsql {
................................................................................
   125    129   } {1}
   126    130   
   127    131   do_test fallocate-2.8 {
   128    132     execsql { COMMIT } db2
   129    133     execsql { PRAGMA wal_checkpoint }
   130    134     file size test.db
   131    135   } [expr 32*1024]
          136  +
          137  +}
   132    138   
   133    139   
   134    140   finish_test
   135    141