/ Check-in [b9b48dd8]
Login

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

Overview
Comment:Fix a problem causing builds with SQLITE_OMIT_WAL defined to fail.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts4aux
Files: files | file ages | folders
SHA1: b9b48dd8ddceec009b5a22a3699e1524542c004a
User & Date: dan 2011-02-01 18:00:43
Context
2011-02-01
18:59
Remove extra instances of the text "checked out." from sqlite.h.in. Also add new file fts3_aux.c to mksqlite3c.tcl. check-in: 9897da22 user: dan tags: fts4aux
18:00
Fix a problem causing builds with SQLITE_OMIT_WAL defined to fail. check-in: b9b48dd8 user: dan tags: fts4aux
17:55
Fix a case in fts4 where a corrupt %_stat table could lead to a crash. check-in: 4ade96ce user: dan tags: fts4aux
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  2846   2846     PAGER_INCR(pPager->nRead);
  2847   2847     IOTRACE(("PGIN %p %d\n", pPager, pgno));
  2848   2848     PAGERTRACE(("FETCH %d page %d hash(%08x)\n",
  2849   2849                  PAGERID(pPager), pgno, pager_pagehash(pPg)));
  2850   2850   
  2851   2851     return rc;
  2852   2852   }
         2853  +
         2854  +/*
         2855  +** Update the value of the change-counter at offsets 24 and 92 in
         2856  +** the header and the sqlite version number at offset 96.
         2857  +**
         2858  +** This is an unconditional update.  See also the pager_incr_changecounter()
         2859  +** routine which only updates the change-counter if the update is actually
         2860  +** needed, as determined by the pPager->changeCountDone state variable.
         2861  +*/
         2862  +static void pager_write_changecounter(PgHdr *pPg){
         2863  +  u32 change_counter;
         2864  +
         2865  +  /* Increment the value just read and write it back to byte 24. */
         2866  +  change_counter = sqlite3Get4byte((u8*)pPg->pPager->dbFileVers)+1;
         2867  +  put32bits(((char*)pPg->pData)+24, change_counter);
         2868  +
         2869  +  /* Also store the SQLite version number in bytes 96..99 and in
         2870  +  ** bytes 92..95 store the change counter for which the version number
         2871  +  ** is valid. */
         2872  +  put32bits(((char*)pPg->pData)+92, change_counter);
         2873  +  put32bits(((char*)pPg->pData)+96, SQLITE_VERSION_NUMBER);
         2874  +}
  2853   2875   
  2854   2876   #ifndef SQLITE_OMIT_WAL
  2855   2877   /*
  2856   2878   ** This function is invoked once for each page that has already been 
  2857   2879   ** written into the log file when a WAL transaction is rolled back.
  2858   2880   ** Parameter iPg is the page number of said page. The pCtx argument 
  2859   2881   ** is actually a pointer to the Pager structure.
................................................................................
  2917   2939       rc = pagerUndoCallback((void *)pPager, pList->pgno);
  2918   2940       pList = pNext;
  2919   2941     }
  2920   2942   
  2921   2943     return rc;
  2922   2944   }
  2923   2945   
  2924         -
  2925         -/*
  2926         -** Update the value of the change-counter at offsets 24 and 92 in
  2927         -** the header and the sqlite version number at offset 96.
  2928         -**
  2929         -** This is an unconditional update.  See also the pager_incr_changecounter()
  2930         -** routine which only updates the change-counter if the update is actually
  2931         -** needed, as determined by the pPager->changeCountDone state variable.
  2932         -*/
  2933         -static void pager_write_changecounter(PgHdr *pPg){
  2934         -  u32 change_counter;
  2935         -
  2936         -  /* Increment the value just read and write it back to byte 24. */
  2937         -  change_counter = sqlite3Get4byte((u8*)pPg->pPager->dbFileVers)+1;
  2938         -  put32bits(((char*)pPg->pData)+24, change_counter);
  2939         -
  2940         -  /* Also store the SQLite version number in bytes 96..99 and in
  2941         -  ** bytes 92..95 store the change counter for which the version number
  2942         -  ** is valid. */
  2943         -  put32bits(((char*)pPg->pData)+92, change_counter);
  2944         -  put32bits(((char*)pPg->pData)+96, SQLITE_VERSION_NUMBER);
  2945         -}
  2946         -
  2947   2946   /*
  2948   2947   ** This function is a wrapper around sqlite3WalFrames(). As well as logging
  2949   2948   ** the contents of the list of pages headed by pList (connected by pDirty),
  2950   2949   ** this function notifies any active backup processes that the pages have
  2951   2950   ** changed.
  2952   2951   **
  2953   2952   ** The list of pages passed into this routine is always sorted by page number.