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

Extra asserts to prove that certain reported errors in btree.c are not really

errors. (CVS 3155)

FossilOrigin-Name: c64542d0e8efd6daecb037009474f4448793e4c0
This commit is contained in:
drh
2006-03-28 00:24:44 +00:00
parent d8f50c4957
commit 7aa8f8588b
3 changed files with 11 additions and 8 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.322 2006/03/23 14:03:00 drh Exp $
** $Id: btree.c,v 1.323 2006/03/28 00:24:45 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -4825,6 +4825,7 @@ static int balance_nonroot(MemPage *pPage){
rc = sqlite3pager_write(pNew->aData);
if( rc ) goto balance_cleanup;
}else{
assert( i>0 );
rc = allocatePage(pBt, &pNew, &pgnoNew[i], pgnoNew[i-1], 0);
if( rc ) goto balance_cleanup;
apNew[i] = pNew;
@@ -4976,6 +4977,8 @@ static int balance_nonroot(MemPage *pPage){
}
}
assert( j==nCell );
assert( nOld>0 );
assert( nNew>0 );
if( (pageFlags & PTF_LEAF)==0 ){
memcpy(&apNew[nNew-1]->aData[8], &apCopy[nOld-1]->aData[8], 4);
}