/ Check-in [d8a12023]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Add a new assert() statement to the snapshot-specific part of sqlite3WalBeginReadTrans().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d8a12023be32bdc6df18b0a5f38b917799854342
User & Date: dan 2015-12-11 14:59:49
Context
2015-12-14
19:42
Add a missing memAboutToChange() macro to vdbe.c, the lack of which was causing an assert() to fail incorrectly. Problem found by libfuzzer. check-in: 1a247911 user: dan tags: trunk
2015-12-11
14:59
Add a new assert() statement to the snapshot-specific part of sqlite3WalBeginReadTrans(). check-in: d8a12023 user: dan tags: trunk
13:51
Simplified alignment constraints in the memory reuse logic of sqlite3VdbeMakeReady(). check-in: e998513e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wal.c.

  2438   2438           ** frames beyond pSnapshot->mxFrame. If either of these conditions are
  2439   2439           ** true, return SQLITE_BUSY_SNAPSHOT. Otherwise, overwrite pWal->hdr
  2440   2440           ** with *pSnapshot and set *pChanged as appropriate for opening the
  2441   2441           ** snapshot.  */
  2442   2442           if( !memcmp(pSnapshot->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt))
  2443   2443            && pSnapshot->mxFrame>=pInfo->nBackfillAttempted
  2444   2444           ){
         2445  +          assert( pWal->readLock>0 );
  2445   2446             memcpy(&pWal->hdr, pSnapshot, sizeof(WalIndexHdr));
  2446   2447             *pChanged = bChanged;
  2447   2448           }else{
  2448   2449             rc = SQLITE_BUSY_SNAPSHOT;
  2449   2450           }
  2450   2451   
  2451   2452           /* Release the shared CKPT lock obtained above. */