/ Check-in [bcdddba4]
Login

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

Overview
Comment:Replace code that became unreachable due to the journal_mode simplification with an assert().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bcdddba4f011cf008d29918bcac59131007a8138
User & Date: drh 2010-07-08 19:19:51
Original Comment: Add a test case to cover code that was left untested by the journal_mode simplification.
Context
2010-07-09
03:19
Reformat WAL code for clearer presentation. Update comments for correctness. Add checks to ensure that corruption in shared-memory does not result in an infinite loop. check-in: 40eaada7 user: drh tags: trunk
2010-07-08
19:19
Replace code that became unreachable due to the journal_mode simplification with an assert(). check-in: bcdddba4 user: drh tags: trunk
18:32
Fix test case numbering in backup_malloc.test and issue when running under Windows. check-in: aef26438 user: shaneh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/pager.c.

  5876   5876     assert(      eMode==PAGER_JOURNALMODE_DELETE
  5877   5877               || eMode==PAGER_JOURNALMODE_TRUNCATE
  5878   5878               || eMode==PAGER_JOURNALMODE_PERSIST
  5879   5879               || eMode==PAGER_JOURNALMODE_OFF 
  5880   5880               || eMode==PAGER_JOURNALMODE_WAL 
  5881   5881               || eMode==PAGER_JOURNALMODE_MEMORY );
  5882   5882   
  5883         -  /* Do not allow the journalmode of a TEMP database to be changed to WAL
         5883  +  /* This routine is only called from the OP_JournalMode opcode, and
         5884  +  ** the logic there will never allow a temporary file to be changed
         5885  +  ** to WAL mode.
  5884   5886     */
  5885         -  if( pPager->tempFile && eMode==PAGER_JOURNALMODE_WAL ){
  5886         -    assert( eOld!=PAGER_JOURNALMODE_WAL );
  5887         -    eMode = eOld;
  5888         -  }
         5887  +  assert( pPager->tempFile==0 || eMode!=PAGER_JOURNALMODE_WAL );
  5889   5888   
  5890   5889     /* Do allow the journalmode of an in-memory database to be set to
  5891   5890     ** anything other than MEMORY or OFF
  5892   5891     */
  5893   5892     if( MEMDB ){
  5894   5893       assert( eOld==PAGER_JOURNALMODE_MEMORY || eOld==PAGER_JOURNALMODE_OFF );
  5895   5894       if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){