SQLite

Check-in [3f4899a923]
Login

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

Overview
Comment:Do not throw an error from within test_journal.c if a database file size is not an integer multiple of the page-size.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3f4899a923f06d48edf6eeeb1c52b01958779efc
User & Date: dan 2012-01-13 14:50:29.345
Context
2012-01-13
15:21
Fix backup2.test so that it passes on OpenBSD (which produces a slightly different error message in one case). (check-in: 227cfe11c4 user: dan tags: trunk)
14:50
Do not throw an error from within test_journal.c if a database file size is not an integer multiple of the page-size. (check-in: 3f4899a923 user: dan tags: trunk)
10:51
Omit test file zerodamage.test from the inmemory_journal permutation. (check-in: 0c0051b1a5 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test_journal.c.
405
406
407
408
409
410
411

412
413
414
415
416
417
418
    if( rc==SQLITE_OK ){
      int ii;
      for(ii=0; rc==SQLITE_OK && ii<pMain->nPage; ii++){
        i64 iOff = (i64)(pMain->nPagesize) * (i64)ii;
        if( iOff==PENDING_BYTE ) continue;
        rc = sqlite3OsRead(pMain->pReal, aData, pMain->nPagesize, iOff);
        pMain->aCksum[ii] = genCksum(aData, pMain->nPagesize);

      }
    }

    start_ioerr_simulation(iSave, iSave2);
  }

  sqlite3_free(aData);







>







405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
    if( rc==SQLITE_OK ){
      int ii;
      for(ii=0; rc==SQLITE_OK && ii<pMain->nPage; ii++){
        i64 iOff = (i64)(pMain->nPagesize) * (i64)ii;
        if( iOff==PENDING_BYTE ) continue;
        rc = sqlite3OsRead(pMain->pReal, aData, pMain->nPagesize, iOff);
        pMain->aCksum[ii] = genCksum(aData, pMain->nPagesize);
        if( ii+1==pMain->nPage && rc==SQLITE_IOERR_SHORT_READ ) rc = SQLITE_OK;
      }
    }

    start_ioerr_simulation(iSave, iSave2);
  }

  sqlite3_free(aData);