mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Modify a test for corruption within the wal checkpoint code to account for the pending-byte page. And for the fact that test configurations might move the pending-byte page.
FossilOrigin-Name: 7dfb74c37e678dde347d9d85846672f82ad282e300e32676330b764be2e4d580
This commit is contained in:
@@ -2009,9 +2009,10 @@ static int walCheckpoint(
|
||||
sqlite3OsFileControl(pWal->pDbFd, SQLITE_FCNTL_CKPT_START, 0);
|
||||
rc = sqlite3OsFileSize(pWal->pDbFd, &nSize);
|
||||
if( rc==SQLITE_OK && nSize<nReq ){
|
||||
if( (nSize+(i64)pWal->hdr.mxFrame*szPage)<nReq ){
|
||||
if( (nSize+65536+(i64)pWal->hdr.mxFrame*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. */
|
||||
rc = SQLITE_CORRUPT_BKPT;
|
||||
}else{
|
||||
|
Reference in New Issue
Block a user