mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Modify the integrity-check code so that each b-tree page inspected is reinitialized while doing so, even if an initialized copy exists in the cache. This prevents an assert from failing when running integrity_check on a corrupt database. (CVS 6877)
FossilOrigin-Name: 709576c670f802bf4b6e5c0e8db2bbde2cc16a90
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.675 2009/07/11 05:06:52 danielk1977 Exp $
|
||||
** $Id: btree.c,v 1.676 2009/07/11 06:55:34 danielk1977 Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** See the header comment on "btreeInt.h" for additional information.
|
||||
@@ -7307,6 +7307,10 @@ static int checkTreePage(
|
||||
"unable to get the page. error code=%d", rc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Clear MemPage.isInit to make sure the corruption detection code in
|
||||
** btreeInitPage() is executed. */
|
||||
pPage->isInit = 0;
|
||||
if( (rc = btreeInitPage(pPage))!=0 ){
|
||||
assert( rc==SQLITE_CORRUPT ); /* The only possible error from InitPage */
|
||||
checkAppendMsg(pCheck, zContext,
|
||||
|
Reference in New Issue
Block a user