Index: src/btree.c ================================================================== --- src/btree.c +++ src/btree.c @@ -627,50 +627,15 @@ sqlite3_free(pMap->aSvpt); sqlite3_free(pMap); pBt->pMap = 0; } } - -static void btreeCheckPtrmap(BtShared *p, int nPage, const char *zLog){ - BtreePtrmap *pMap = p->pMap; - if( pMap ){ - int n = MIN(1 + nPage - (int)pMap->iFirst, 5); - int i; - for(i=0; iaPtr[i].eType; - if( (eType==PTRMAP_OVERFLOW1 || - eType==PTRMAP_OVERFLOW2 || - eType==PTRMAP_BTREE) && pMap->aPtr[i].parent==0 - ){ - sqlite3_log(SQLITE_ERROR, - "Bitvec: error at (%s) - (%d/%d %d/%d %d/%d %d/%d %d/%d)", - zLog, - (int)pMap->aPtr[0].eType, (int)pMap->aPtr[0].parent, - (n>1 ? (int)pMap->aPtr[1].eType : -1), - (n>1 ? (int)pMap->aPtr[1].parent : -1), - - (n>2 ? (int)pMap->aPtr[2].eType : -1), - (n>2 ? (int)pMap->aPtr[2].parent : -1), - - (n>3 ? (int)pMap->aPtr[3].eType : -1), - (n>3 ? (int)pMap->aPtr[3].parent : -1), - - (n>4 ? (int)pMap->aPtr[4].eType : -1), - (n>4 ? (int)pMap->aPtr[4].parent : -1) - ); - abort(); - break; - } - } - } -} #else /* SQLITE_OMIT_CONCURRENT */ # define btreePtrmapAllocate(x) SQLITE_OK # define btreePtrmapDelete(x) # define btreePtrmapBegin(x,y) SQLITE_OK # define btreePtrmapEnd(x,y,z) -# define btreeCheckPtrmap(a,b,c) #endif /* SQLITE_OMIT_CONCURRENT */ static void releasePage(MemPage *pPage); /* Forward reference */ /* @@ -4121,12 +4086,10 @@ BtreePtrmap *pMap = pBt->pMap; Pgno iTrunk = get4byte(&p1[32]); Pgno nPage = btreePagecount(pBt); u32 nFree = get4byte(&p1[36]); - btreeCheckPtrmap(pBt, nPage, "btreeFixUnlocked(1)"); - assert( pBt->pMap ); rc = sqlite3PagerUpgradeSnapshot(pPager, pPage1->pDbPage); assert( p1==pPage1->aData ); if( rc==SQLITE_OK ){ @@ -8715,11 +8678,10 @@ } } assert( pCur->apPage[pCur->iPage]->nOverflow==0 ); end_insert: - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeInsert()"); return rc; } /* ** Delete the entry that the cursor is pointing to. @@ -8811,23 +8773,19 @@ ** invalidate any incrblob cursors open on the row being deleted. */ if( pCur->pKeyInfo==0 ){ invalidateIncrblobCursors(p, pCur->pgnoRoot, pCur->info.nKey, 0); } - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(0)"); - /* Make the page containing the entry to be deleted writable. Then free any ** overflow pages associated with the entry and finally remove the cell ** itself from within the page. */ rc = sqlite3PagerWrite(pPage->pDbPage); if( rc ) return rc; rc = clearCell(pPage, pCell, &info); dropCell(pPage, iCellIdx, info.nSize, &rc); if( rc ) return rc; - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(1)"); - /* If the cell deleted was not located on a leaf page, then the cursor ** is currently pointing to the largest entry in the sub-tree headed ** by the child-page of the cell that was just deleted from an internal ** node. The cell from the leaf node needs to be moved to the internal ** node to replace the deleted cell. */ @@ -8849,12 +8807,10 @@ } dropCell(pLeaf, pLeaf->nCell-1, nCell, &rc); if( rc ) return rc; } - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(2)"); - /* Balance the tree. If the entry deleted was located on a leaf page, ** then the cursor still points to that page. In this case the first ** call to balance() repairs the tree, and the if(...) condition is ** never true. ** @@ -8874,12 +8830,10 @@ releasePage(pCur->apPage[pCur->iPage--]); } rc = balance(pCur); } - btreeCheckPtrmap(pBt, pBt->nPage, "sqlite3BtreeDelete(3)"); - if( rc==SQLITE_OK ){ if( bSkipnext ){ assert( bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB) ); assert( pPage==pCur->apPage[pCur->iPage] || CORRUPT_DB ); assert( (pPage->nCell>0 || CORRUPT_DB) && iCellIdx<=pPage->nCell );