SQLite

Check-in [2e7a0050e1]
Login

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

Overview
Comment:Fix an assert() in sqlite3WalRead().
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 2e7a0050e192dd197d4db92393ab120897c14836
User & Date: dan 2010-04-30 10:24:54.000
Context
2010-04-30
11:43
Add a missing walIndexUnmap() call to the checkpoint code. Change a couple of SQLITE_CANTOPEN constants to SQLITE_CANTOPEN_BKPT. (check-in: 1f9e8c5c27 user: dan tags: wal)
10:24
Fix an assert() in sqlite3WalRead(). (check-in: 2e7a0050e1 user: dan tags: wal)
10:06
Add missing mutexes to unixShmClose(). (check-in: a4741cb54d user: dan tags: wal)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/wal.c.
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
** Read a page from the log, if it is present. 
*/
int sqlite3WalRead(Wal *pWal, Pgno pgno, int *pInWal, u8 *pOut){
  u32 iRead = 0;
  u32 *aData; 
  int iFrame = (pWal->hdr.iLastPg & 0xFFFFFF00);

  assert( pWal->lockState==SQLITE_SHM_READ );
  walIndexMap(pWal);

  /* Do a linear search of the unindexed block of page-numbers (if any) 
  ** at the end of the wal-index. An alternative to this would be to
  ** build an index in private memory each time a read transaction is
  ** opened on a new snapshot.
  */







|







908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
** Read a page from the log, if it is present. 
*/
int sqlite3WalRead(Wal *pWal, Pgno pgno, int *pInWal, u8 *pOut){
  u32 iRead = 0;
  u32 *aData; 
  int iFrame = (pWal->hdr.iLastPg & 0xFFFFFF00);

  assert( pWal->lockState==SQLITE_SHM_READ||pWal->lockState==SQLITE_SHM_WRITE );
  walIndexMap(pWal);

  /* Do a linear search of the unindexed block of page-numbers (if any) 
  ** at the end of the wal-index. An alternative to this would be to
  ** build an index in private memory each time a read transaction is
  ** opened on a new snapshot.
  */