Skip to content

Commit

Permalink
Merge pull request #1956 from tursodatabase/dont-ignore-resultcode-fr…
Browse files Browse the repository at this point in the history
…om-checkpoint-finish-cb

wal.c: do not ignore the result code of xCb in walCheckpoint
  • Loading branch information
jussisaurio authored Feb 14, 2025
2 parents 701a8cf + 90f0751 commit 4c7ed18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions libsql-ffi/bundled/src/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -67644,9 +67644,11 @@ static int walCheckpoint(
if (xCb) {
rc = (xCb)(pCbData, mxSafeFrame, NULL, 0, 0, 0);
}
i64 szDb = pWal->hdr.nPage*(i64)szPage;
testcase( IS_BIG_INT(szDb) );
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
if( rc==SQLITE_OK ){
i64 szDb = pWal->hdr.nPage*(i64)szPage;
testcase( IS_BIG_INT(szDb) );
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
}
if( rc==SQLITE_OK ){
rc = sqlite3OsSync(pWal->pDbFd, CKPT_SYNC_FLAGS(sync_flags));
}
Expand Down
8 changes: 5 additions & 3 deletions libsql-sqlite3/src/wal.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,9 +2134,11 @@ static int walCheckpoint(
if (xCb) {
rc = (xCb)(pCbData, mxSafeFrame, NULL, 0, 0, 0);
}
i64 szDb = pWal->hdr.nPage*(i64)szPage;
testcase( IS_BIG_INT(szDb) );
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
if( rc==SQLITE_OK ){
i64 szDb = pWal->hdr.nPage*(i64)szPage;
testcase( IS_BIG_INT(szDb) );
rc = sqlite3OsTruncate(pWal->pDbFd, szDb);
}
if( rc==SQLITE_OK ){
rc = sqlite3OsSync(pWal->pDbFd, CKPT_SYNC_FLAGS(sync_flags));
}
Expand Down

0 comments on commit 4c7ed18

Please sign in to comment.