Lines Matching refs:iPage
20978 int iPage, in sqlite3OsShmMap() argument
20984 return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp); in sqlite3OsShmMap()
56174 static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){
56178 if( pWal->nWiData<=iPage ){
56179 int nByte = sizeof(u32*)*(iPage+1);
56187 sizeof(u32*)*(iPage+1-pWal->nWiData));
56189 pWal->nWiData = iPage+1;
56193 if( pWal->apWiData[iPage]==0 ){
56195 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ);
56196 if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM_BKPT;
56198 rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ,
56199 pWal->writeLock, (void volatile **)&pWal->apWiData[iPage]
56201 assert( pWal->apWiData[iPage]!=0 || rc!=SQLITE_OK || pWal->writeLock==0 );
56202 testcase( pWal->apWiData[iPage]==0 && rc==SQLITE_OK );
56212 *ppPage = pWal->apWiData[iPage];
56213 assert( iPage==0 || *ppPage || rc!=SQLITE_OK );
56331 u32 iPage, /* Database page number for frame */
56339 sqlite3Put4byte(&aFrame[0], iPage);
56478 static int walHash(u32 iPage){
56479 assert( iPage>0 );
56481 return (iPage*HASHTABLE_HASH_1) & (HASHTABLE_NSLOT-1);
56635 static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
56675 for(iKey=walHash(iPage); aHash[iKey]; iKey=walNextHash(iKey)){
56678 aPgno[idx] = iPage;
59939 i8 iPage; /* Index of current page in apPage */
61050 if( pCur->iPage>=0 ){
61051 for(i=0; i<pCur->iPage; i++){
61055 pCur->iPage = -1;
61185 testcase( p->iPage>=0 );
62519 assert( pCur==0 || pCur->iPage>0 );
62552 pCur->iPage--;
62553 pCur->pPage = pCur->apPage[pCur->iPage];
64709 pCur->iPage = -1;
64767 memset(p, 0, offsetof(BtCursor, iPage));
65230 assert( pCur->iPage>=0 && pCur->pPage );
65289 assert( pCur!=0 && pCur->iPage>=0 && pCur->pPage);
65342 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
65343 assert( pCur->iPage>=0 );
65344 if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
65349 pCur->aiIdx[pCur->iPage] = pCur->ix;
65350 pCur->apPage[pCur->iPage] = pCur->pPage;
65352 pCur->iPage++;
65390 assert( pCur->iPage>0 );
65393 pCur->apPage[pCur->iPage-1],
65394 pCur->aiIdx[pCur->iPage-1],
65397 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
65400 pCur->ix = pCur->aiIdx[pCur->iPage-1];
65402 pCur->pPage = pCur->apPage[--pCur->iPage];
65435 assert( pCur->eState < CURSOR_REQUIRESEEK || pCur->iPage<0 );
65436 assert( pCur->pgnoRoot>0 || pCur->iPage<0 );
65438 if( pCur->iPage>=0 ){
65439 if( pCur->iPage ){
65441 while( --pCur->iPage ){
65442 releasePageNotNull(pCur->apPage[pCur->iPage]);
65451 assert( pCur->iPage==(-1) );
65465 pCur->iPage = 0;
65596 for(ii=0; ii<pCur->iPage; ii++){
65728 assert( pCur->iPage==0 || pCur->apPage[0]->intKey==pCur->curIntKey );
65929 for(i=0; i<pCur->iPage; i++){
66000 if( pCur->iPage==0 ){
66096 if( pCur->iPage==0 ){
66331 Pgno iPage;
66338 iPage = get4byte(&aData[8+i*4]);
66339 if( iPage<=nearby ){
66359 iPage = get4byte(&aData[8+closest*4]);
66360 testcase( iPage==mxPage );
66361 if( iPage>mxPage ){
66365 testcase( iPage==mxPage );
66367 || (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
66370 *pPgno = iPage;
66476 static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
66485 assert( CORRUPT_DB || iPage>1 );
66486 assert( !pMemPage || pMemPage->pgno==iPage );
66488 if( iPage<2 ) return SQLITE_CORRUPT_BKPT;
66493 pPage = btreePageLookup(pBt, iPage);
66506 if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
66518 ptrmapPut(pBt, iPage, PTRMAP_FREEPAGE, 0, &rc);
66567 put4byte(&pTrunk->aData[8+nLeaf*4], iPage);
66571 rc = btreeSetHasContent(pBt, iPage);
66584 if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){
66593 put4byte(&pPage1->aData[32], iPage);
68448 int iPage = pCur->iPage;
68451 if( iPage==0 ){
68462 pCur->iPage = 1;
68475 MemPage * const pParent = pCur->apPage[iPage-1];
68476 int const iIdx = pCur->aiIdx[iPage-1];
68524 rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1,
68545 pCur->iPage--;
68546 assert( pCur->iPage>=0 );
68547 pCur->pPage = pCur->apPage[pCur->iPage];
68783 assert( pCur->iPage<0 || pCur->pPage->nOverflow==0 );
68828 iCellDepth = pCur->iPage;
68901 if( iCellDepth<pCur->iPage-1 ){
68936 if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){
68938 pCur->iPage--;
68939 while( pCur->iPage>iCellDepth ){
68940 releasePage(pCur->apPage[pCur->iPage--]);
68942 pCur->pPage = pCur->apPage[pCur->iPage];
68948 assert( bPreserve && (pCur->iPage==iCellDepth || CORRUPT_DB) );
69463 if( pCur->iPage==0 ){
69555 static int checkRef(IntegrityCk *pCheck, Pgno iPage){
69556 if( iPage==0 ) return 1;
69557 if( iPage>pCheck->nPage ){
69558 checkAppendMsg(pCheck, "invalid page number %d", iPage);
69561 if( getPageReferenced(pCheck, iPage) ){
69562 checkAppendMsg(pCheck, "2nd reference to page %d", iPage);
69565 setPageReferenced(pCheck, iPage);
69607 int iPage, /* Page number for first page in the list */
69612 int iFirst = iPage;
69616 if( iPage<1 ){
69622 if( checkRef(pCheck, iPage) ) break;
69623 if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage, 0) ){
69624 checkAppendMsg(pCheck, "failed to get page %d", iPage);
69632 checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0);
69637 "freelist leaf count too big on page %d", iPage);
69660 checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage);
69664 iPage = get4byte(pOvflData);
69667 if( isFreeList && N<(iPage!=0) ){
69742 int iPage, /* Page number of the page to check */
69776 if( iPage==0 ) return 0;
69777 if( checkRef(pCheck, iPage) ) return 0;
69779 pCheck->v1 = iPage;
69780 if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){
69821 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
69875 checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
69886 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
69961 "Multiple uses for byte %u of page %d", x>>16, iPage);
69977 nFrag, data[hdr+7], iPage);
71095 Pgno iPage,
71101 if( !isFatalError(p->rc) && iPage<p->iNext ){
71109 rc = backupOnePage(p, iPage, aData, 1);
71118 SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){
71119 if( pBackup ) backupUpdate(pBackup, iPage, aData);
177790 int iPage; /* Current entry in aPage[] */
177954 pCsr->iPage = 0;
178141 pCsr->iPage = 0;
178150 StatPage *p = &pCsr->aPage[pCsr->iPage];
178185 if( pCsr->iPage==0 ) return statNext(pCursor);
178186 pCsr->iPage--;
178189 pCsr->iPage++;
178190 assert( p==&pCsr->aPage[pCsr->iPage-1] );
178210 StatPage *p = &pCsr->aPage[pCsr->iPage];