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

The fix in (6395) was not correct. Fix #3756 a different way. (CVS 6397)

FossilOrigin-Name: 9278f7b1e1f2d0d4c2f8829ca801a769e512c2a6
This commit is contained in:
danielk1977
2009-03-28 10:54:22 +00:00
parent 8594373a25
commit ac86169fff
4 changed files with 17 additions and 12 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.578 2009/03/25 15:43:09 danielk1977 Exp $
** $Id: btree.c,v 1.579 2009/03/28 10:54:23 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -4427,8 +4427,15 @@ static int allocateBtreePage(
** at the end of the file instead of one. The first allocated page
** becomes a new pointer-map page, the second is used by the caller.
*/
MemPage *pPg = 0;
TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno));
assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
rc = sqlite3BtreeGetPage(pBt, *pPgno, &pPg, 0);
if( rc==SQLITE_OK ){
rc = sqlite3PagerWrite(pPg->pDbPage);
releasePage(pPg);
}
if( rc ) return rc;
(*pPgno)++;
if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ (*pPgno)++; }
}