diff options
author | drh <drh@noemail.net> | 2016-02-04 09:48:12 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-02-04 09:48:12 +0000 |
commit | 6d258995e65e606f65b9189c409801c3da01f4ef (patch) | |
tree | 688a6da9a25df1148f55fb101e7a3c6c880986f2 /src | |
parent | fabe393da8f09bee7f40781e2bae9edacebe8619 (diff) | |
download | sqlite-6d258995e65e606f65b9189c409801c3da01f4ef.tar.gz sqlite-6d258995e65e606f65b9189c409801c3da01f4ef.zip |
Refinements to synchronous logic:
(1) Use PAGER_SYNCHRONOUS_FULL rather than the corresponding magic number.
(2) Honor SQLITE_NO_SYNC on xDelete calls with sync
(3) Count xDelete syncs during testing
(4) Fix #ifs on SQLITE_EXTRA_DURABLE so that directory syncs on journal
unlink are off by default.
FossilOrigin-Name: e3157cb5ad0d22758e766a95fb1463a7810f7d7f
Diffstat (limited to 'src')
-rw-r--r-- | src/attach.c | 3 | ||||
-rw-r--r-- | src/os_unix.c | 9 | ||||
-rw-r--r-- | src/pager.c | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/src/attach.c b/src/attach.c index fd5cc7c76..12d3ac3ff 100644 --- a/src/attach.c +++ b/src/attach.c @@ -156,7 +156,8 @@ static void attachFunc( sqlite3BtreeSecureDelete(aNew->pBt, sqlite3BtreeSecureDelete(db->aDb[0].pBt,-1) ); #ifndef SQLITE_OMIT_PAGER_PRAGMAS - sqlite3BtreeSetPagerFlags(aNew->pBt, 3 | (db->flags & PAGER_FLAGS_MASK)); + sqlite3BtreeSetPagerFlags(aNew->pBt, + PAGER_SYNCHRONOUS_FULL | (db->flags & PAGER_FLAGS_MASK)); #endif sqlite3BtreeLeave(aNew->pBt); } diff --git a/src/os_unix.c b/src/os_unix.c index 81422f215..fe1fc6af1 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -5887,12 +5887,7 @@ static int unixDelete( int fd; rc = osOpenDirectory(zPath, &fd); if( rc==SQLITE_OK ){ -#if OS_VXWORKS - if( fsync(fd)==-1 ) -#else - if( fsync(fd) ) -#endif - { + if( full_fsync(fd,0,0) ){ rc = unixLogError(SQLITE_IOERR_DIR_FSYNC, "fsync", zPath); } robust_close(0, fd, __LINE__); @@ -6936,7 +6931,7 @@ static int proxyTakeConch(unixFile *pFile){ writeSize = PROXY_PATHINDEX + strlen(&writeBuffer[PROXY_PATHINDEX]); robust_ftruncate(conchFile->h, writeSize); rc = unixWrite((sqlite3_file *)conchFile, writeBuffer, writeSize, 0); - fsync(conchFile->h); + full_fsync(conchFile->h,0,0); /* If we created a new conch file (not just updated the contents of a ** valid conch file), try to match the permissions of the database */ diff --git a/src/pager.c b/src/pager.c index 8f1635d9e..5c61968e3 100644 --- a/src/pager.c +++ b/src/pager.c @@ -4823,7 +4823,7 @@ act_like_temp_file: assert( pPager->ckptSyncFlags==0 ); }else{ pPager->fullSync = 1; -#ifdef SQLITE_EXTRA_DURABLE +#if SQLITE_EXTRA_DURABLE pPager->extraSync = 1; #else pPager->extraSync = 0; |