SQLite

Check-in [56c7d111bf]
Login

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

Overview
Comment:Fix a case where the doNotSyncSpill flag may remain permanently set following an IO error.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56c7d111bf7013be95a4c2a657a4861eee91db91
User & Date: dan 2010-06-26 17:15:08.000
Original Comment: Fix a case where the doNotSyncSpill flag may remain permanently set following aIO error.
Context
2010-06-26
19:02
Remove a NEVER() in pager that can in fact be reached in obscure failure cases. (check-in: 42b8bd1c70 user: drh tags: trunk)
17:15
Fix a case where the doNotSyncSpill flag may remain permanently set following an IO error. (check-in: 56c7d111bf user: dan tags: trunk)
15:42
When synchronous=NORMAL, use the same journal file format as with synchronous=FULL (i.e. multiple journal headers within the one journal). Fix for [d11f09d36e]. (check-in: 2eaf5ee0d9 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870

4871
4872
4873
4874
4875
4876
4877
    /* This trick assumes that both the page-size and sector-size are
    ** an integer power of 2. It sets variable pg1 to the identifier
    ** of the first page of the sector pPg is located on.
    */
    pg1 = ((pPg->pgno-1) & ~(nPagePerSector-1)) + 1;

    rc = sqlite3PagerPagecount(pPager, (int *)&nPageCount);
    if( rc ) return rc;
    if( pPg->pgno>nPageCount ){
      nPage = (pPg->pgno - pg1)+1;
    }else if( (pg1+nPagePerSector-1)>nPageCount ){
      nPage = nPageCount+1-pg1;
    }else{
      nPage = nPagePerSector;
    }
    assert(nPage>0);
    assert(pg1<=pPg->pgno);
    assert((pg1+nPage)>pPg->pgno);


    for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
      Pgno pg = pg1+ii;
      PgHdr *pPage;
      if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){
        if( pg!=PAGER_MJ_PGNO(pPager) ){
          rc = sqlite3PagerGet(pPager, pg, &pPage);







|
|
|
|
|
|
|
|
|
|
|
>







4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
    /* This trick assumes that both the page-size and sector-size are
    ** an integer power of 2. It sets variable pg1 to the identifier
    ** of the first page of the sector pPg is located on.
    */
    pg1 = ((pPg->pgno-1) & ~(nPagePerSector-1)) + 1;

    rc = sqlite3PagerPagecount(pPager, (int *)&nPageCount);
    if( rc==SQLITE_OK ){
      if( pPg->pgno>nPageCount ){
        nPage = (pPg->pgno - pg1)+1;
      }else if( (pg1+nPagePerSector-1)>nPageCount ){
        nPage = nPageCount+1-pg1;
      }else{
        nPage = nPagePerSector;
      }
      assert(nPage>0);
      assert(pg1<=pPg->pgno);
      assert((pg1+nPage)>pPg->pgno);
    }

    for(ii=0; ii<nPage && rc==SQLITE_OK; ii++){
      Pgno pg = pg1+ii;
      PgHdr *pPage;
      if( pg==pPg->pgno || !sqlite3BitvecTest(pPager->pInJournal, pg) ){
        if( pg!=PAGER_MJ_PGNO(pPager) ){
          rc = sqlite3PagerGet(pPager, pg, &pPage);