1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Sync the database file in sqlite3_ckpt_close(), even if the checkpoint has not finished.

FossilOrigin-Name: e2729d623c6e9d0b3049049f3f3051bbb479184f
This commit is contained in:
dan
2014-10-22 11:30:08 +00:00
parent d6446a0abe
commit 9f0da72b09
3 changed files with 12 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
C Test\sthat\ssqlite3ota_open()\sworks\swith\sURI\spaths.\sFix\ssome\sother\sissues. C Sync\sthe\sdatabase\sfile\sin\ssqlite3_ckpt_close(),\seven\sif\sthe\scheckpoint\shas\snot\sfinished.
D 2014-10-21T19:35:03.426 D 2014-10-22T11:30:08.642
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -309,7 +309,7 @@ F src/vdbemem.c 31d8eabb0cd78bfeab4e5124c7363c3e9e54db9f
F src/vdbesort.c 975aeffa99acb0991b2f288d30294756bff41438 F src/vdbesort.c 975aeffa99acb0991b2f288d30294756bff41438
F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010 F src/vdbetrace.c 7e4222955e07dd707a2f360c0eb73452be1cb010
F src/vtab.c cb0c194303fea276b48d7d4b6d970b5a96bde8de F src/vtab.c cb0c194303fea276b48d7d4b6d970b5a96bde8de
F src/wal.c cbce609ec35e4d170ec0db385880f5f12c9c7fbd F src/wal.c 99c5b0a68e525d854d86f93be215e9c2bfb7b194
F src/wal.h 0d3ba0c3f1b4c25796cb213568a84b9f9063f465 F src/wal.h 0d3ba0c3f1b4c25796cb213568a84b9f9063f465
F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804 F src/walker.c c253b95b4ee44b21c406e2a1052636c31ea27804
F src/where.c 2947912f1f3d6a7766fe087fd532a5d688d745b1 F src/where.c 2947912f1f3d6a7766fe087fd532a5d688d745b1
@@ -1215,7 +1215,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 2402baa0027ca65e9a5106b8b9c4e10f40d2cbc3 P 6fd09854feb46739f42b7e7a5e76680d5f9b8c5a
R be41b5fa90bd92c9b4cc1682fc718b4c R b3f281b9e115a81e4161ab510da7f09d
U dan U dan
Z 3c98460b0b6af0c08ea70d54ed77c905 Z 3d20cbfe4cbde996e6770d4067fcc8a6

View File

@@ -1 +1 @@
6fd09854feb46739f42b7e7a5e76680d5f9b8c5a e2729d623c6e9d0b3049049f3f3051bbb479184f

View File

@@ -1764,8 +1764,8 @@ static int walCheckpointFinalize(WalCkpt *p){
int rc = p->rc; int rc = p->rc;
Wal *pWal = p->pWal; Wal *pWal = p->pWal;
/* If work was completed */ if( rc==SQLITE_DONE ){
if( p->pIter && rc==SQLITE_DONE ){ /* If work was completed */
rc = SQLITE_OK; rc = SQLITE_OK;
if( p->mxSafeFrame==walIndexHdr(pWal)->mxFrame ){ if( p->mxSafeFrame==walIndexHdr(pWal)->mxFrame ){
i64 szDb = pWal->hdr.nPage*(i64)p->szPage; i64 szDb = pWal->hdr.nPage*(i64)p->szPage;
@@ -1779,6 +1779,9 @@ static int walCheckpointFinalize(WalCkpt *p){
p->pInfo->nBackfill = p->mxSafeFrame; p->pInfo->nBackfill = p->mxSafeFrame;
} }
p->rc = rc; 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 */ /* Release the reader lock held while backfilling */