From: dan Date: Wed, 22 Oct 2014 11:30:08 +0000 (+0000) Subject: Sync the database file in sqlite3_ckpt_close(), even if the checkpoint has not finished. X-Git-Tag: version-3.8.11~252^2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f0da72b09edfb8112e346060e6cbdc272dfaa05;p=thirdparty%2Fsqlite.git Sync the database file in sqlite3_ckpt_close(), even if the checkpoint has not finished. FossilOrigin-Name: e2729d623c6e9d0b3049049f3f3051bbb479184f --- diff --git a/manifest b/manifest index e7d8dcf1aa..90e0ac70d8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Test\sthat\ssqlite3ota_open()\sworks\swith\sURI\spaths.\sFix\ssome\sother\sissues. -D 2014-10-21T19:35:03.426 +C Sync\sthe\sdatabase\sfile\sin\ssqlite3_ckpt_close(),\seven\sif\sthe\scheckpoint\shas\snot\sfinished. +D 2014-10-22T11:30:08.642 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -309,7 +309,7 @@ F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f F src/vdbesort.c 975aeffa99acb0991b2f288d30294756bff41438 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vtab.c cb0c194303fea276b48d7d4b6d970b5a96bde8de -F src/wal.c cbce609ec35e4d170ec0db385880f5f12c9c7fbd +F src/wal.c 99c5b0a68e525d854d86f93be215e9c2bfb7b194 F src/wal.h 0d3ba0c3f1b4c25796cb213568a84b9f9063f465 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/where.c 2947912f1f3d6a7766fe087fd532a5d688d745b1 @@ -1215,7 +1215,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 2402baa0027ca65e9a5106b8b9c4e10f40d2cbc3 -R be41b5fa90bd92c9b4cc1682fc718b4c +P 6fd09854feb46739f42b7e7a5e76680d5f9b8c5a +R b3f281b9e115a81e4161ab510da7f09d U dan -Z 3c98460b0b6af0c08ea70d54ed77c905 +Z 3d20cbfe4cbde996e6770d4067fcc8a6 diff --git a/manifest.uuid b/manifest.uuid index a140abbb67..b8ae20a48a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6fd09854feb46739f42b7e7a5e76680d5f9b8c5a \ No newline at end of file +e2729d623c6e9d0b3049049f3f3051bbb479184f \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index fb6d87657f..70bd918072 100644 --- a/src/wal.c +++ b/src/wal.c @@ -1764,8 +1764,8 @@ static int walCheckpointFinalize(WalCkpt *p){ int rc = p->rc; Wal *pWal = p->pWal; - /* If work was completed */ - if( p->pIter && rc==SQLITE_DONE ){ + if( rc==SQLITE_DONE ){ + /* If work was completed */ rc = SQLITE_OK; if( p->mxSafeFrame==walIndexHdr(pWal)->mxFrame ){ i64 szDb = pWal->hdr.nPage*(i64)p->szPage; @@ -1779,6 +1779,9 @@ static int walCheckpointFinalize(WalCkpt *p){ p->pInfo->nBackfill = p->mxSafeFrame; } p->rc = rc; + }else if( rc==SQLITE_OK && p->sync_flags ){ + /* If work was not completed, but no error has occured. */ + p->rc = sqlite3OsSync(pWal->pDbFd, p->sync_flags); } /* Release the reader lock held while backfilling */