1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Avoid changing the pager journal-mode once a write-transaction is open, even if no database pages have been modified. (CVS 6554)

FossilOrigin-Name: ad8aba3eff90d42b936e3644f10cbbd431eebad8
This commit is contained in:
danielk1977
2009-04-28 05:27:20 +00:00
parent 1691cd4bc0
commit f761f76262
3 changed files with 10 additions and 9 deletions

View File

@@ -18,7 +18,7 @@
** 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 $
** @(#) $Id: pager.c,v 1.583 2009/04/28 05:27:20 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -5218,6 +5218,7 @@ int sqlite3PagerJournalMode(Pager *pPager, int eMode){
&& (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY
|| eMode==PAGER_JOURNALMODE_OFF)
&& !pPager->dbModified
&& (!isOpen(pPager->jfd) || 0==pPager->journalOff)
){
if( isOpen(pPager->jfd) ){
sqlite3OsClose(pPager->jfd);