/ Check-in [6ae76172]
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 NEVER to sqlite3PagerCommitPhaseTwo() because it is now no longer possible to invoke that function without holding a RESERVED lock.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6ae7617298c70f8e03dd0ed73b8153d4871fb023
User & Date: drh 2010-07-02 01:18:12
Context
2010-07-02
11:27
Additional test cases to cover branches in pager.c. check-in: eddfb2b4 user: dan tags: trunk
01:18
Add a NEVER to sqlite3PagerCommitPhaseTwo() because it is now no longer possible to invoke that function without holding a RESERVED lock. check-in: 6ae76172 user: drh tags: trunk
2010-07-01
19:45
If you delete a database file but not its *-wal file, then open the database (thus creating a new empty database file) the *-wal file is automatically deleted. check-in: 95c69dfb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  5298   5298     if( NEVER(pPager->errCode) ) return pPager->errCode;
  5299   5299   
  5300   5300     /* This function should not be called if the pager is not in at least
  5301   5301     ** PAGER_RESERVED state. **FIXME**: Make it so that this test always
  5302   5302     ** fails - make it so that we never reach this point if we do not hold
  5303   5303     ** all necessary locks.
  5304   5304     */
  5305         -  if( pPager->state<PAGER_RESERVED ) return SQLITE_ERROR;
         5305  +  if( NEVER(pPager->state<PAGER_RESERVED) ) return SQLITE_ERROR;
  5306   5306   
  5307   5307     /* An optimization. If the database was not actually modified during
  5308   5308     ** this transaction, the pager is running in exclusive-mode and is
  5309   5309     ** using persistent journals, then this function is a no-op.
  5310   5310     **
  5311   5311     ** The start of the journal file currently contains a single journal 
  5312   5312     ** header with the nRec field set to 0. If such a journal is used as