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

Prepare for the 2.5.5 release. (CVS 661)

FossilOrigin-Name: 00f83c2576f4a9689720d344788f66219c1f6827
This commit is contained in:
drh
2002-07-06 16:32:14 +00:00
parent 8e298f92f6
commit 0de8c11292
10 changed files with 294 additions and 20 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.63 2002/06/21 13:09:17 drh Exp $
** $Id: btree.c,v 1.64 2002/07/06 16:32:15 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -2760,7 +2760,7 @@ static void checkAppendMsg(IntegrityCk *pCheck, char *zMsg1, char *zMsg2){
*/
static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){
if( iPage==0 ) return 1;
if( iPage>pCheck->nPage ){
if( iPage>pCheck->nPage || iPage<0 ){
char zBuf[100];
sprintf(zBuf, "invalid page number %d", iPage);
checkAppendMsg(pCheck, zContext, zBuf);
@@ -3006,6 +3006,10 @@ char *sqliteBtreeIntegrityCheck(Btree *pBt, int *aRoot, int nRoot){
sCheck.pBt = pBt;
sCheck.pPager = pBt->pPager;
sCheck.nPage = sqlitepager_pagecount(sCheck.pPager);
if( sCheck.nPage==0 ){
unlockBtreeIfUnused(pBt);
return 0;
}
sCheck.anRef = sqliteMalloc( (sCheck.nPage+1)*sizeof(sCheck.anRef[0]) );
sCheck.anRef[1] = 1;
for(i=2; i<=sCheck.nPage; i++){ sCheck.anRef[i] = 0; }