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

In pageReinit() in btree.c, only reinitialize a page if there are one or more references to it, not including the transient reference held by pager.c. This was always the intent. (CVS 6424)

FossilOrigin-Name: 0c5a7d1117cfb322d1c89da89e8887b0bb091602
This commit is contained in:
danielk1977
2009-04-01 17:13:51 +00:00
parent 769e97e032
commit d217e6f16d
3 changed files with 11 additions and 10 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.584 2009/04/01 16:25:33 danielk1977 Exp $
** $Id: btree.c,v 1.585 2009/04/01 17:13:51 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -1320,10 +1320,11 @@ static void releasePage(MemPage *pPage){
static void pageReinit(DbPage *pData){
MemPage *pPage;
pPage = (MemPage *)sqlite3PagerGetExtra(pData);
assert( sqlite3PagerPageRefcount(pData)>0 );
if( pPage->isInit ){
assert( sqlite3_mutex_held(pPage->pBt->mutex) );
pPage->isInit = 0;
if( sqlite3PagerPageRefcount(pData)>0 ){
if( sqlite3PagerPageRefcount(pData)>1 ){
/* pPage might not be a btree page; it might be an overflow page
** or ptrmap page or a free page. In those cases, the following
** call to sqlite3BtreeInitPage() will likely return SQLITE_CORRUPT.