1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix an assert() that can be false when doing an incremental vacuum on a

corrupt database file.  dbsqlfuzz cced0668cfd4da4eb2382cb9dd26c17c64aaff76.

FossilOrigin-Name: 15b801016fa204b8e4b7c89e236adb73dd57687959d825664de5097370b24030
This commit is contained in:
drh
2021-04-05 17:50:38 +00:00
parent 240e36c0e3
commit e3814ee026
4 changed files with 68 additions and 11 deletions

View File

@@ -3936,7 +3936,8 @@ static void assertTruncateConstraint(Pager *pPager){
** then continue writing to the database.
*/
void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){
assert( pPager->dbSize>=nPage );
assert( pPager->dbSize>=nPage || CORRUPT_DB );
testcase( pPager->dbSize<nPage );
assert( pPager->eState>=PAGER_WRITER_CACHEMOD );
pPager->dbSize = nPage;