diff options
author | dan <dan@noemail.net> | 2020-06-29 19:58:26 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2020-06-29 19:58:26 +0000 |
commit | 4ffaa7c5dedbc86b5736b139bc0465524ab3db51 (patch) | |
tree | 666cf4c61783a8b8b7d1ef423fafaf8187de65c9 /src/wal.c | |
parent | 5289c51050a9cc4860dca4afcbb276710b7ff8d6 (diff) | |
download | sqlite-4ffaa7c5dedbc86b5736b139bc0465524ab3db51.tar.gz sqlite-4ffaa7c5dedbc86b5736b139bc0465524ab3db51.zip |
Passive checkpoints do not use the busy-handler. So, in order to minimize visible changes for legacy applications, do not enable blocking locks for passive checkpoints.
FossilOrigin-Name: 9c2b4bdd03716bf492ba85198717f3084ebf187bdb068893bd1ff8662362df89
Diffstat (limited to 'src/wal.c')
-rw-r--r-- | src/wal.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -3701,10 +3701,9 @@ int sqlite3WalCheckpoint( if( pWal->readOnly ) return SQLITE_READONLY; WALTRACE(("WAL%p: checkpoint begins\n", pWal)); - /* Enable blocking locks, if possible. If blocking locks are successfully - ** enabled, set xBusy2=0 so that the busy-handler is never invoked. */ + /* Enable blocking locks, if possible. */ sqlite3WalDb(pWal, db); - (void)walEnableBlocking(pWal); + if( xBusy2 ) (void)walEnableBlocking(pWal); /* IMPLEMENTATION-OF: R-62028-47212 All calls obtain an exclusive ** "checkpoint" lock on the database file. @@ -3746,7 +3745,7 @@ int sqlite3WalCheckpoint( if( rc==SQLITE_OK ){ walDisableBlocking(pWal); rc = walIndexReadHdr(pWal, &isChanged); - (void)walEnableBlocking(pWal); + if( xBusy2 ) (void)walEnableBlocking(pWal); if( isChanged && pWal->pDbFd->pMethods->iVersion>=3 ){ sqlite3OsUnfetch(pWal->pDbFd, 0, 0); } |