mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-28 19:36:04 +03:00
Fix an assert() failure occuring in corrupt.test. (CVS 4034)
FossilOrigin-Name: 3c54cddf23e3b9f62815d1b825110563f78cc325
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.385 2007/05/23 13:34:32 danielk1977 Exp $
|
||||
** $Id: btree.c,v 1.386 2007/05/24 07:22:42 danielk1977 Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** See the header comment on "btreeInt.h" for additional information.
|
||||
@@ -1659,12 +1659,15 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
|
||||
static int setChildPtrmaps(MemPage *pPage){
|
||||
int i; /* Counter variable */
|
||||
int nCell; /* Number of cells in page pPage */
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
int rc; /* Return code */
|
||||
BtShared *pBt = pPage->pBt;
|
||||
int isInitOrig = pPage->isInit;
|
||||
Pgno pgno = pPage->pgno;
|
||||
|
||||
sqlite3BtreeInitPage(pPage, 0);
|
||||
rc = sqlite3BtreeInitPage(pPage, pPage->pParent);
|
||||
if( rc!=SQLITE_OK ){
|
||||
goto set_child_ptrmaps_out;
|
||||
}
|
||||
nCell = pPage->nCell;
|
||||
|
||||
for(i=0; i<nCell; i++){
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.340 2007/05/09 20:35:31 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.341 2007/05/24 07:22:42 danielk1977 Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_DISKIO
|
||||
#include "sqliteInt.h"
|
||||
@@ -1081,6 +1081,10 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
|
||||
** page in the pager cache. In this case just update the pager cache,
|
||||
** not the database file. The page is left marked dirty in this case.
|
||||
**
|
||||
** An exception to the above rule: If the database is in no-sync mode
|
||||
** and a page is moved during an incremental vacuum then the page may
|
||||
** not be in the pager cache.
|
||||
**
|
||||
** If in EXCLUSIVE state, then we update the pager cache if it exists
|
||||
** and the main file. The page is then marked not dirty.
|
||||
**
|
||||
@@ -1098,7 +1102,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int useCksum){
|
||||
** cache or else it is marked as needSync==0.
|
||||
*/
|
||||
pPg = pager_lookup(pPager, pgno);
|
||||
assert( pPager->state>=PAGER_EXCLUSIVE || pPg!=0 );
|
||||
assert( pPager->state>=PAGER_EXCLUSIVE || pPg!=0 || pPager->noSync );
|
||||
PAGERTRACE3("PLAYBACK %d page %d\n", PAGERID(pPager), pgno);
|
||||
if( pPager->state>=PAGER_EXCLUSIVE && (pPg==0 || pPg->needSync==0) ){
|
||||
rc = sqlite3OsSeek(pPager->fd, (pgno-1)*(i64)pPager->pageSize);
|
||||
|
||||
Reference in New Issue
Block a user