Skip to content
File

Blob: patches/sqlite/0004-invalid-wal-on-rollback-fix.patch

740 bytes
1diff -u5 -r sqlite-src-pristine/src/wal.c sqlite-src-modified/src/wal.c
2--- sqlite-src-pristine/src/wal.c 2024-10-21 09:47:53.000000000 -0700
3+++ sqlite-src-modified/src/wal.c 2025-06-17 23:10:43.657220118 -0700
4@@ -3760,10 +3760,11 @@
5 rc = xUndo(pUndoCtx, walFramePgno(pWal, iFrame));
6 }
7 if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal);
8 }
9 SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
10+ pWal->iReCksum = 0;
11 }
12 return rc;
13 }
14
15 /*
16@@ -3807,10 +3808,13 @@
17 pWal->hdr.aFrameCksum[1] = aWalData[2];
18 SEH_TRY {
19 walCleanupHash(pWal);
20 }
21 SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; )
22+ if( pWal->iReCksum>pWal->hdr.mxFrame ){
23+ pWal->iReCksum = 0;
24+ }
25 }
26
27 return rc;
28 }
29