aboutsummaryrefslogtreecommitdiff
path: root/src/pager.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-02-02 02:22:30 +0000
committerdrh <drh@noemail.net>2016-02-02 02:22:30 +0000
commit33c1eb64772caf48a33d92e1a3c5a577c9ba1aa9 (patch)
treee820c4a4276381c4c71f8cf891e75dc67302fa8b /src/pager.c
parente1ed0bb6077cc223fa54f58ae835f133d1c4aa59 (diff)
parentb8db549832d2acc2fc30327e6fb5c0474820f122 (diff)
downloadsqlite-33c1eb64772caf48a33d92e1a3c5a577c9ba1aa9.tar.gz
sqlite-33c1eb64772caf48a33d92e1a3c5a577c9ba1aa9.zip
Merge all recent enhancements from trunk.
FossilOrigin-Name: f3f9200115caf4b356f90ec97c351d1afbcb9bf6
Diffstat (limited to 'src/pager.c')
-rw-r--r--src/pager.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/pager.c b/src/pager.c
index 2c904d2df..0afbe215c 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -429,6 +429,20 @@ int sqlite3PagerTrace=1; /* True to enable tracing */
#define MAX_SECTOR_SIZE 0x10000
/*
+** If the option SQLITE_EXTRA_DURABLE option is set at compile-time, then
+** SQLite will do extra fsync() operations when synchronous==FULL to help
+** ensure that transactions are durable across a power failure. Most
+** applications are happy as long as transactions are consistent across
+** a power failure, and are perfectly willing to lose the last transaction
+** in exchange for the extra performance of avoiding directory syncs.
+** And so the default SQLITE_EXTRA_DURABLE setting is off.
+*/
+#ifndef SQLITE_EXTRA_DURABLE
+# define SQLITE_EXTRA_DURABLE 0
+#endif
+
+
+/*
** An instance of the following structure is allocated for each active
** savepoint and statement transaction in the system. All such structures
** are stored in the Pager.aSavepoint[] array, which is allocated and
@@ -1983,7 +1997,8 @@ static int pager_end_transaction(Pager *pPager, int hasMaster, int bCommit){
);
sqlite3OsClose(pPager->jfd);
if( bDelete ){
- rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
+ rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal,
+ pPager->fullSync && SQLITE_EXTRA_DURABLE);
}
}
}