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

Refactor wal.c to use the VFS. This check-in compiles and links and works

ok as long as you leave WAL turned off, but WAL does not work.

FossilOrigin-Name: 62db5fa3b61be885b2d94e9b9ce3877b2c588350
This commit is contained in:
drh
2010-04-29 22:34:07 +00:00
parent 31cbbbad1c
commit 7ed91f2344
14 changed files with 534 additions and 1210 deletions

View File

@@ -306,15 +306,15 @@ void sqlite3_result_error_nomem(sqlite3_context *pCtx){
pCtx->s.db->mallocFailed = 1;
}
static int doLogCallbacks(sqlite3 *db){
static int doWalCallbacks(sqlite3 *db){
int i;
int rc = SQLITE_OK;
for(i=0; i<db->nDb; i++){
Btree *pBt = db->aDb[i].pBt;
if( pBt ){
int nEntry = sqlite3PagerLogCallback(sqlite3BtreePager(pBt));
if( db->xLogCallback && nEntry>0 && rc==SQLITE_OK
&& db->xLogCallback(db->pLogArg, db, db->aDb[i].zName, nEntry)
int nEntry = sqlite3PagerWalCallback(sqlite3BtreePager(pBt));
if( db->xWalCallback && nEntry>0 && rc==SQLITE_OK
&& db->xWalCallback(db->pWalArg, db, db->aDb[i].zName, nEntry)
){
rc = sqlite3PagerCheckpoint(sqlite3BtreePager(pBt));
}
@@ -406,7 +406,7 @@ static int sqlite3Step(Vdbe *p){
if( rc==SQLITE_DONE ){
assert( p->rc==SQLITE_OK );
p->rc = doLogCallbacks(db);
p->rc = doWalCallbacks(db);
if( p->rc!=SQLITE_OK ){
rc = SQLITE_ERROR;
}