/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/pager.c.

5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
  assert(      eMode==PAGER_JOURNALMODE_DELETE
            || eMode==PAGER_JOURNALMODE_TRUNCATE
            || eMode==PAGER_JOURNALMODE_PERSIST
            || eMode==PAGER_JOURNALMODE_OFF 
            || eMode==PAGER_JOURNALMODE_WAL 
            || eMode==PAGER_JOURNALMODE_MEMORY );

  /* Do not allow the journalmode of a TEMP database to be changed to WAL
  */
  if( pPager->tempFile && eMode==PAGER_JOURNALMODE_WAL ){
    assert( eOld!=PAGER_JOURNALMODE_WAL );
    eMode = eOld;
  }

  /* Do allow the journalmode of an in-memory database to be set to
  ** anything other than MEMORY or OFF
  */
  if( MEMDB ){
    assert( eOld==PAGER_JOURNALMODE_MEMORY || eOld==PAGER_JOURNALMODE_OFF );
    if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){







|
|
|
|
|
<







5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887

5888
5889
5890
5891
5892
5893
5894
  assert(      eMode==PAGER_JOURNALMODE_DELETE
            || eMode==PAGER_JOURNALMODE_TRUNCATE
            || eMode==PAGER_JOURNALMODE_PERSIST
            || eMode==PAGER_JOURNALMODE_OFF 
            || eMode==PAGER_JOURNALMODE_WAL 
            || eMode==PAGER_JOURNALMODE_MEMORY );

  /* This routine is only called from the OP_JournalMode opcode, and
  ** the logic there will never allow a temporary file to be changed
  ** to WAL mode.
  */
  assert( pPager->tempFile==0 || eMode!=PAGER_JOURNALMODE_WAL );


  /* Do allow the journalmode of an in-memory database to be set to
  ** anything other than MEMORY or OFF
  */
  if( MEMDB ){
    assert( eOld==PAGER_JOURNALMODE_MEMORY || eOld==PAGER_JOURNALMODE_OFF );
    if( eMode!=PAGER_JOURNALMODE_MEMORY && eMode!=PAGER_JOURNALMODE_OFF ){