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

Merge latest trunk changes into this branch.

FossilOrigin-Name: cb1f6f18e74aeff522c332cb6c8f4c202bba8fba4ff7869198e4501ffa4a0387
This commit is contained in:
dan
2020-11-26 18:08:59 +00:00
153 changed files with 4650 additions and 1285 deletions

View File

@@ -2601,9 +2601,10 @@ static int walCheckpoint(
rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
if( rc==SQLITE_OK && nSize<nReq ){
i64 mx = pWal->hdr.mxFrame + (bWal2?walidxGetMxFrame(&pWal->hdr,1):0);
if( (nSize+mx*szPage)<nReq ){
if( (nSize+65536+mx*szPage)<nReq ){
/* If the size of the final database is larger than the current
** database plus the amount of data in the wal file, then there
** database plus the amount of data in the wal file, plus the
** maximum size of the pending-byte page (65536 bytes), then
** must be corruption somewhere. Or in the case of wal2 mode,
** plus the amount of data in both wal files. */
rc = SQLITE_CORRUPT_BKPT;