Lines Matching refs:iPage
17374 int iPage,
17380 return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp);
50811 ** Obtain a pointer to the iPage'th page of the wal-index. The wal-index
50819 static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){
50823 if( pWal->nWiData<=iPage ){
50824 int nByte = sizeof(u32*)*(iPage+1);
50832 sizeof(u32*)*(iPage+1-pWal->nWiData));
50834 pWal->nWiData = iPage+1;
50838 if( pWal->apWiData[iPage]==0 ){
50840 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ);
50841 if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM;
50843 rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ,
50844 pWal->writeLock, (void volatile **)&pWal->apWiData[iPage]
50853 *ppPage = pWal->apWiData[iPage];
50854 assert( iPage==0 || *ppPage || rc!=SQLITE_OK );
50972 u32 iPage, /* Database page number for frame */
50980 sqlite3Put4byte(&aFrame[0], iPage);
51116 static int walHash(u32 iPage){
51117 assert( iPage>0 );
51119 return (iPage*HASHTABLE_HASH_1) & (HASHTABLE_NSLOT-1);
51273 static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
51313 for(iKey=walHash(iPage); aHash[iKey]; iKey=walNextHash(iKey)){
51316 aPgno[idx] = iPage;
54029 i8 iPage; /* Index of current page in apPage */
55090 for(i=0; i<=pCur->iPage; i++){
55094 pCur->iPage = -1;
55225 testcase( p->iPage>0 );
56456 ** And if the fetch fails, this routine must decrement pCur->iPage.
56474 assert( pCur==0 || ppPage==&pCur->apPage[pCur->iPage] );
56476 assert( pCur==0 || pCur->iPage>0 );
56507 if( pCur ) pCur->iPage--;
58372 for(i=0; i<=p->iPage; i++){
58588 pCur->iPage = -1;
58647 memset(p, 0, offsetof(BtCursor, iPage));
58674 for(i=0; i<=pCur->iPage; i++){
58696 int iPage = pCur->iPage;
58698 btreeParseCell(pCur->apPage[iPage], pCur->aiIdx[iPage], &info);
58706 int iPage = pCur->iPage;
58708 btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info);
58760 assert( pCur->iPage>=0 );
58761 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
58762 assert( pCur->apPage[pCur->iPage]->intKeyLeaf==1 );
58916 MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */
58925 assert( pCur->aiIdx[pCur->iPage]<pPage->nCell );
59113 assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] );
59114 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
59140 assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] );
59141 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
59171 assert( pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]);
59175 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
59177 assert( pCur->info.pPayload>pCur->apPage[pCur->iPage]->aData || CORRUPT_DB );
59178 assert( pCur->info.pPayload<pCur->apPage[pCur->iPage]->aDataEnd ||CORRUPT_DB);
59179 amt = (int)(pCur->apPage[pCur->iPage]->aDataEnd - pCur->info.pPayload);
59222 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
59223 assert( pCur->iPage>=0 );
59224 if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
59229 pCur->iPage++;
59230 pCur->aiIdx[pCur->iPage] = 0;
59231 return getAndInitPage(pBt, newPgno, &pCur->apPage[pCur->iPage],
59268 assert( pCur->iPage>0 );
59269 assert( pCur->apPage[pCur->iPage] );
59271 pCur->apPage[pCur->iPage-1],
59272 pCur->aiIdx[pCur->iPage-1],
59273 pCur->apPage[pCur->iPage]->pgno
59275 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
59278 releasePageNotNull(pCur->apPage[pCur->iPage--]);
59318 if( pCur->iPage>=0 ){
59319 while( pCur->iPage ){
59320 assert( pCur->apPage[pCur->iPage]!=0 );
59321 releasePageNotNull(pCur->apPage[pCur->iPage--]);
59327 assert( pCur->iPage==(-1) );
59334 pCur->iPage = 0;
59347 ** if pCur->iPage>=0). But this is not so if the database is corrupted
59387 while( rc==SQLITE_OK && !(pPage = pCur->apPage[pCur->iPage])->leaf ){
59388 assert( pCur->aiIdx[pCur->iPage]<pPage->nCell );
59389 pgno = get4byte(findCell(pPage, pCur->aiIdx[pCur->iPage]));
59412 while( !(pPage = pCur->apPage[pCur->iPage])->leaf ){
59414 pCur->aiIdx[pCur->iPage] = pPage->nCell;
59418 pCur->aiIdx[pCur->iPage] = pPage->nCell-1;
59436 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
59439 assert( pCur->apPage[pCur->iPage]->nCell>0 );
59463 for(ii=0; ii<pCur->iPage; ii++){
59466 assert( pCur->aiIdx[pCur->iPage]==pCur->apPage[pCur->iPage]->nCell-1 );
59467 assert( pCur->apPage[pCur->iPage]->leaf );
59475 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
59565 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage] );
59566 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->isInit );
59567 assert( pCur->eState==CURSOR_INVALID || pCur->apPage[pCur->iPage]->nCell>0 );
59570 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
59578 MemPage *pPage = pCur->apPage[pCur->iPage];
59593 pCur->aiIdx[pCur->iPage] = (u16)idx;
59614 pCur->aiIdx[pCur->iPage] = (u16)idx;
59681 pCur->aiIdx[pCur->iPage] = (u16)idx;
59702 pCur->aiIdx[pCur->iPage] = (u16)idx;
59714 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
59715 pCur->aiIdx[pCur->iPage] = (u16)idx;
59726 pCur->aiIdx[pCur->iPage] = (u16)lwr;
59802 pPage = pCur->apPage[pCur->iPage];
59803 idx = ++pCur->aiIdx[pCur->iPage];
59820 if( pCur->iPage==0 ){
59826 pPage = pCur->apPage[pCur->iPage];
59827 }while( pCur->aiIdx[pCur->iPage]>=pPage->nCell );
59850 pPage = pCur->apPage[pCur->iPage];
59851 if( (++pCur->aiIdx[pCur->iPage])>=pPage->nCell ){
59852 iPage]--;
59913 pPage = pCur->apPage[pCur->iPage];
59916 int idx = pCur->aiIdx[pCur->iPage];
59921 while( pCur->aiIdx[pCur->iPage]==0 ){
59922 if( pCur->iPage==0 ){
59932 pCur->aiIdx[pCur->iPage]--;
59933 pPage = pCur->apPage[pCur->iPage];
59951 || pCur->aiIdx[pCur->iPage]==0
59952 || pCur->apPage[pCur->iPage]->leaf==0
59956 pCur->aiIdx[pCur->iPage]--;
60159 Pgno iPage;
60166 iPage = get4byte(&aData[8+i*4]);
60167 if( iPage<=nearby ){
60187 iPage = get4byte(&aData[8+closest*4]);
60188 testcase( iPage==mxPage );
60189 if( iPage>mxPage ){
60193 testcase( iPage==mxPage );
60195 || (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
60198 *pPgno = iPage;
60293 ** This function is used to add page iPage to the database file free-list.
60298 ** corresponding to page iPage handy, it may pass it as the second value.
60304 iPage){
60313 assert( CORRUPT_DB || iPage>1 );
60314 assert( !pMemPage || pMemPage->pgno==iPage );
60316 if( iPage<2 ) return SQLITE_CORRUPT_BKPT;
60321 pPage = btreePageLookup(pBt, iPage);
60334 if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
60346 ptrmapPut(pBt, iPage, PTRMAP_FREEPAGE, 0, &rc);
60395 put4byte(&pTrunk->aData[8+nLeaf*4], iPage);
60399 rc = btreeSetHasContent(pBt, iPage);
60412 if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){
60421 put4byte(&pPage1->aData[32], iPage);
62281 int iPage = pCur->iPage;
62282 MemPage *pPage = pCur->apPage[iPage];
62284 if( iPage==0 ){
62294 pCur->iPage = 1;
62305 MemPage * const pParent = pCur->apPage[iPage-1];
62306 int const iIdx = pCur->aiIdx[iPage-1];
62353 rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1,
62374 pCur->iPage--;
62375 assert( pCur->iPage>=0 );
62482 pPage = pCur->apPage[pCur->iPage];
62496 idx = pCur->aiIdx[pCur->iPage];
62513 idx = ++pCur->aiIdx[pCur->iPage];
62549 pCur->apPage[pCur->iPage]->nOverflow = 0;
62552 assert( pCur->apPage[pCur->iPage]->nOverflow==0 );
62584 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
62587 iCellDepth = pCur->iPage;
62655 MemPage *pLeaf = pCur->apPage[pCur->iPage];
62688 if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){
62689 while( pCur->iPage>iCellDepth ){
62690 releasePage(pCur->apPage[pCur->iPage--]);
62697 assert( bPreserve && pCur->iPage==iCellDepth );
62698 assert( pPage==pCur->apPage[pCur->iPage] );
63214 pPage = pCur->apPage[pCur->iPage];
63222 ** pCur->aiIdx[pCur->iPage] value is set to the index of the parent cell
63231 if( pCur->iPage==0 ){
63237 }while ( pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell );
63239 pCur->aiIdx[pCur->iPage]++;
63240 pPage = pCur->apPage[pCur->iPage];
63246 iIdx = pCur->aiIdx[pCur->iPage];
63316 ** Add 1 to the reference count for page iPage. If this is the second
63323 static int checkRef(IntegrityCk *pCheck, Pgno iPage){
63324 if( iPage==0 ) return 1;
63325 if( iPage>pCheck->nPage ){
63326 checkAppendMsg(pCheck, "invalid page number %d", iPage);
63329 if( getPageReferenced(pCheck, iPage) ){
63330 checkAppendMsg(pCheck, "2nd reference to page %d", iPage);
63333 setPageReferenced(pCheck, iPage);
63375 int iPage, /* Page number for first page in the list */
63380 int iFirst = iPage;
63384 if( iPage<1 ){
63390 if( checkRef(pCheck, iPage) ) break;
63391 if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage) ){
63392 checkAppendMsg(pCheck, "failed to get page %d", iPage);
63400 checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0);
63405 "freelist leaf count too big on page %d", iPage);
63422 /* If this database supports auto-vacuum and iPage is not the last
63424 ** the following page matches iPage.
63428 checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage);
63432 iPage = get4byte(pOvflData);
63435 if( isFreeList && N<(iPage!=0) ){
63510 int iPage, /* Page number of the page to check */
63544 if( iPage==0 ) return 0;
63545 if( checkRef(pCheck, iPage) ) return 0;
63547 pCheck->v1 = iPage;
63548 if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){
63589 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
63642 checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
63653 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
63728 "Multiple uses for byte %u of page %d", x>>16, iPage);
63744 nFrag, data[hdr+7], iPage);
64078 assert( pCsr->apPage[pCsr->iPage]->intKey );
64836 ** This function is called after the contents of page iPage of the
64837 ** source database have been modified. If page iPage has already been
64839 ** destination is now invalidated. The destination copy of iPage needs
64849 Pgno iPage,
64855 if( !isFatalError(p->rc) && iPage<p->iNext ){
64856 /* The backup process p has already copied page iPage. But now it
64863 rc = backupOnePage(p, iPage, aData, 1);
64872 SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){
64873 if( pBackup ) backupUpdate(pBackup, iPage, aData);
162962 int iPage; /* Current entry in aPage[] */
163124 pCsr->iPage = 0;
163311 pCsr->iPage = 0;
163320 StatPage *p = &pCsr->aPage[pCsr->iPage];
163355 if( pCsr->iPage==0 ) return statNext(pCursor);
163356 pCsr->iPage--;
163359 pCsr->iPage++;
163360 assert( p==&pCsr->aPage[pCsr->iPage-1] );
163380 StatPage *p = &pCsr->aPage[pCsr->iPage];