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

Back out [2904fcbeebba9189], mostly. The page bitmap is needed even for a

partial integrity_check in order to avoid an infinite loops while walking the
database.

FossilOrigin-Name: dd6e03b37356e2961abd97f636402c09744c98c3033f3435503958c6219f9121
This commit is contained in:
drh
2023-10-27 10:49:17 +00:00
parent 1ecf531fb0
commit c42276f63e
3 changed files with 12 additions and 18 deletions

View File

@@ -10484,7 +10484,6 @@ static void setPageReferenced(IntegrityCk *pCheck, Pgno iPg){
*/
static int checkRef(IntegrityCk *pCheck, Pgno iPage){
if( iPage>pCheck->nCkPage || iPage==0 ){
if( pCheck->nCkPage==0 ) return 0; /* omit reference counting */
checkAppendMsg(pCheck, "invalid page number %u", iPage);
return 1;
}
@@ -10990,15 +10989,10 @@ int sqlite3BtreeIntegrityCheck(
goto integrity_ck_cleanup;
}
if( bPartial ){
sCheck.nCkPage = 0;
sCheck.aPgRef = 0;
}else{
sCheck.aPgRef = sqlite3MallocZero((sCheck.nCkPage / 8)+ 1);
if( !sCheck.aPgRef ){
checkOom(&sCheck);
goto integrity_ck_cleanup;
}
sCheck.aPgRef = sqlite3MallocZero((sCheck.nCkPage / 8)+ 1);
if( !sCheck.aPgRef ){
checkOom(&sCheck);
goto integrity_ck_cleanup;
}
sCheck.heap = (u32*)sqlite3PageMalloc( pBt->pageSize );
if( sCheck.heap==0 ){