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

Change the behavior of the sqlite3_wal_hook() callback. It should now return

SQLITE_OK or an error code and the error code is propagated back up the 
stack.  If a checkpoint is desired, the callback should invoke
sqlite3_wal_callback() itself.

FossilOrigin-Name: 1b14195e05fe5551992a39246ec3bcf6a33bbfac
This commit is contained in:
drh
2010-05-05 20:00:25 +00:00
parent ccd13d1f80
commit 5def0843f1
8 changed files with 44 additions and 43 deletions

View File

@@ -318,10 +318,8 @@ static int doWalCallbacks(sqlite3 *db){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
int nEntry = sqlite3PagerWalCallback(sqlite3BtreePager(pBt));
if( db->xWalCallback && nEntry>0 && rc==SQLITE_OK
&& db->xWalCallback(db->pWalArg, db, db->aDb[i].zName, nEntry)
){
rc = sqlite3Checkpoint(db, i);
if( db->xWalCallback && nEntry>0 && rc==SQLITE_OK ){
rc = db->xWalCallback(db->pWalArg, db, db->aDb[i].zName, nEntry);
}
}
}