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

Detect when a child node of a btree page has zero entries and report that

as a case of database corruption. (CVS 887)

FossilOrigin-Name: 66c80ae232a78ecb010280ab1aa684cb78b0662f
This commit is contained in:
drh
2003-03-30 18:41:22 +00:00
parent 0be9df076a
commit 1dd8c40e8f
3 changed files with 9 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.84 2003/03/19 03:14:01 drh Exp $
** $Id: btree.c,v 1.85 2003/03/30 18:41:22 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -1389,6 +1389,7 @@ static int moveToChild(BtCursor *pCur, int newPgno){
sqlitepager_unref(pCur->pPage);
pCur->pPage = pNewPage;
pCur->idx = 0;
if( pNewPage->nCell<1 ) return SQLITE_CORRUPT;
return SQLITE_OK;
}