SQLite

Check-in [ad8aba3eff]
Login

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

Overview
Comment:Avoid changing the pager journal-mode once a write-transaction is open, even if no database pages have been modified. (CVS 6554)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ad8aba3eff90d42b936e3644f10cbbd431eebad8
User & Date: danielk1977 2009-04-28 05:27:20.000
Context
2009-04-28
11:10
Fix an assert that could fail after a parse error in expr.c. (CVS 6555) (check-in: a37d1174eb user: danielk1977 tags: trunk)
05:27
Avoid changing the pager journal-mode once a write-transaction is open, even if no database pages have been modified. (CVS 6554) (check-in: ad8aba3eff user: danielk1977 tags: trunk)
04:51
Add test cases for sqlite3_complete with an EXPLAIN QUERY PLAN on a CREATE TRIGGER statement. Ticket #3828. (CVS 6553) (check-in: 6b86b40eda user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.582 2009/04/20 17:43:03 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.583 2009/04/28 05:27:20 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/
5214
5215
5216
5217
5218
5219
5220

5221
5222
5223
5224
5225
5226
5227
            || eMode==PAGER_JOURNALMODE_OFF 
            || eMode==PAGER_JOURNALMODE_MEMORY );
  assert( PAGER_JOURNALMODE_QUERY<0 );
  if( eMode>=0
   && (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY 
              || eMode==PAGER_JOURNALMODE_OFF)
   && !pPager->dbModified

  ){
    if( isOpen(pPager->jfd) ){
      sqlite3OsClose(pPager->jfd);
    }
    pPager->journalMode = (u8)eMode;
  }
  return (int)pPager->journalMode;







>







5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
            || eMode==PAGER_JOURNALMODE_OFF 
            || eMode==PAGER_JOURNALMODE_MEMORY );
  assert( PAGER_JOURNALMODE_QUERY<0 );
  if( eMode>=0
   && (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY 
              || eMode==PAGER_JOURNALMODE_OFF)
   && !pPager->dbModified
   && (!isOpen(pPager->jfd) || 0==pPager->journalOff)
  ){
    if( isOpen(pPager->jfd) ){
      sqlite3OsClose(pPager->jfd);
    }
    pPager->journalMode = (u8)eMode;
  }
  return (int)pPager->journalMode;