/ Check-in [40db3e40]
Login

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

Overview
Comment:Fix an assert() failure caused by setting "PRAGMA journal_mode=off" on an database in exclusive-mode that has already opened the journal file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:40db3e40126db1035fcc12989026915744dc5651
User & Date: dan 2015-05-01 16:57:24
Context
2015-05-01
18:00
Fix an assert in RTREE that would fire if the rtree table is misdeclared. check-in: 9a45409c user: drh tags: trunk
16:57
Fix an assert() failure caused by setting "PRAGMA journal_mode=off" on an database in exclusive-mode that has already opened the journal file. check-in: 40db3e40 user: dan tags: trunk
15:25
Remove obselete comment text from the description of the Table object. No changes to code. check-in: 6566b72a user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pager.c.

7006
7007
7008
7009
7010
7011
7012


7013
7014
7015
7016
7017
7018
7019
        if( rc==SQLITE_OK && state==PAGER_READER ){
          pagerUnlockDb(pPager, SHARED_LOCK);
        }else if( state==PAGER_OPEN ){
          pager_unlock(pPager);
        }
        assert( state==pPager->eState );
      }


    }
  }

  /* Return the new journal mode */
  return (int)pPager->journalMode;
}








>
>







7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
        if( rc==SQLITE_OK && state==PAGER_READER ){
          pagerUnlockDb(pPager, SHARED_LOCK);
        }else if( state==PAGER_OPEN ){
          pager_unlock(pPager);
        }
        assert( state==pPager->eState );
      }
    }else if( eMode==PAGER_JOURNALMODE_OFF ){
      sqlite3OsClose(pPager->jfd);
    }
  }

  /* Return the new journal mode */
  return (int)pPager->journalMode;
}

Changes to test/jrnlmode.test.

550
551
552
553
554
555
556
557















558
do_execsql_test jrnlmode-8.24 { PRAGMA journal_mode=TRUNCATE }  {truncate}
do_execsql_test jrnlmode-8.25 { PRAGMA locking_mode=NORMAL }    {normal}
do_execsql_test jrnlmode-8.26 { CREATE TABLE t4(w) }            {}
do_execsql_test jrnlmode-8.27 { BEGIN IMMEDIATE }               {}
do_execsql_test jrnlmode-8.28 { PRAGMA journal_mode=DELETE }    {delete}
do_execsql_test jrnlmode-8.29 { COMMIT }                        {}
do_execsql_test jrnlmode-8.30 { PRAGMA journal_mode=DELETE }    {delete}
















finish_test








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
do_execsql_test jrnlmode-8.24 { PRAGMA journal_mode=TRUNCATE }  {truncate}
do_execsql_test jrnlmode-8.25 { PRAGMA locking_mode=NORMAL }    {normal}
do_execsql_test jrnlmode-8.26 { CREATE TABLE t4(w) }            {}
do_execsql_test jrnlmode-8.27 { BEGIN IMMEDIATE }               {}
do_execsql_test jrnlmode-8.28 { PRAGMA journal_mode=DELETE }    {delete}
do_execsql_test jrnlmode-8.29 { COMMIT }                        {}
do_execsql_test jrnlmode-8.30 { PRAGMA journal_mode=DELETE }    {delete}

# Assertion fault on 2015-05-01
do_test jrnlmode-9.1 {
  forcedelete test2.db
  sqlite3 db2 test2.db
  breakpoint
  db2 eval {CREATE TEMP TABLE t(l); PRAGMA journal_mode=off;}
  db2 close
} {}
do_execsql_test jrnlmode-9.2 {
  PRAGMA locking_mode = exclusive;
  CREATE TABLE tx(a);
  PRAGMA journal_mode = off;
} {exclusive off}


finish_test