1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Disable synchronous writes to the master journal when PRAGMA synchronous=OFF

for all database files.  Ticket #1375. (CVS 2630)

FossilOrigin-Name: 644b96aa23de7e828280d35785db840a4fa9413d
This commit is contained in:
drh
2005-08-27 16:36:48 +00:00
parent 9cc5abd769
commit 2c8997b9a5
8 changed files with 122 additions and 17 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.209 2005/08/21 16:54:25 drh Exp $
** @(#) $Id: pager.c,v 1.210 2005/08/27 16:36:49 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
@@ -779,7 +779,7 @@ static int writeMasterJournal(Pager *pPager, const char *zMaster){
if( rc!=SQLITE_OK ) return rc;
rc = sqlite3OsWrite(&pPager->jfd, aJournalMagic, sizeof(aJournalMagic));
pPager->needSync = 1;
pPager->needSync = !pPager->noSync;
return rc;
}
@@ -3345,6 +3345,14 @@ const char *sqlite3pager_journalname(Pager *pPager){
return pPager->zJournal;
}
/*
** Return true if fsync() calls are disabled for this pager. Return FALSE
** if fsync()s are executed normally.
*/
int sqlite3pager_nosync(Pager *pPager){
return pPager->noSync;
}
/*
** Set the codec for this pager
*/