Lines Matching refs:iPage

16614   int iPage,  in sqlite3OsShmMap()  argument
16620 return id->pMethods->xShmMap(id, iPage, pgsz, bExtend, pp); in sqlite3OsShmMap()
49420 static int walIndexPage(Wal *pWal, int iPage, volatile u32 **ppPage){
49424 if( pWal->nWiData<=iPage ){
49425 int nByte = sizeof(u32*)*(iPage+1);
49433 sizeof(u32*)*(iPage+1-pWal->nWiData));
49435 pWal->nWiData = iPage+1;
49439 if( pWal->apWiData[iPage]==0 ){
49441 pWal->apWiData[iPage] = (u32 volatile *)sqlite3MallocZero(WALINDEX_PGSZ);
49442 if( !pWal->apWiData[iPage] ) rc = SQLITE_NOMEM;
49444 rc = sqlite3OsShmMap(pWal->pDbFd, iPage, WALINDEX_PGSZ,
49445 pWal->writeLock, (void volatile **)&pWal->apWiData[iPage]
49454 *ppPage = pWal->apWiData[iPage];
49455 assert( iPage==0 || *ppPage || rc!=SQLITE_OK );
49573 u32 iPage, /* Database page number for frame */
49581 sqlite3Put4byte(&aFrame[0], iPage);
49717 static int walHash(u32 iPage){
49718 assert( iPage>0 );
49720 return (iPage*HASHTABLE_HASH_1) & (HASHTABLE_NSLOT-1);
49874 static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
49914 for(iKey=walHash(iPage); aHash[iKey]; iKey=walNextHash(iKey)){
49917 aPgno[idx] = iPage;
52600 i16 iPage; /* Index of current page in apPage */
53636 for(i=0; i<=pCur->iPage; i++){
53640 pCur->iPage = -1;
53739 testcase( p->iPage>0 );
56701 for(i=0; i<=p->iPage; i++){
56918 pCur->iPage = -1;
56967 memset(p, 0, offsetof(BtCursor, iPage));
56989 for(i=0; i<=pCur->iPage; i++){
57018 int iPage = pCur->iPage;
57020 btreeParseCell(pCur->apPage[iPage], pCur->aiIdx[iPage], &info);
57030 int iPage = pCur->iPage;
57031 btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info);
57041 int iPage = pCur->iPage; \
57042 btreeParseCell(pCur->apPage[iPage],pCur->aiIdx[iPage],&pCur->info); \
57095 assert( pCur->iPage>=0 );
57096 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
57097 assert( pCur->apPage[pCur->iPage]->intKeyLeaf==1 );
57251 MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */
57260 assert( pCur->aiIdx[pCur->iPage]<pPage->nCell );
57448 assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] );
57449 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
57475 assert( pCur->iPage>=0 && pCur->apPage[pCur->iPage] );
57476 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
57506 assert( pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]);
57510 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
57512 assert( pCur->info.pPayload>pCur->apPage[pCur->iPage]->aData || CORRUPT_DB );
57513 assert( pCur->info.pPayload<pCur->apPage[pCur->iPage]->aDataEnd ||CORRUPT_DB);
57514 amt = (int)(pCur->apPage[pCur->iPage]->aDataEnd - pCur->info.pPayload);
57554 int i = pCur->iPage;
57560 assert( pCur->iPage<BTCURSOR_MAX_DEPTH );
57561 assert( pCur->iPage>=0 );
57562 if( pCur->iPage>=(BTCURSOR_MAX_DEPTH-1) ){
57570 pCur->iPage++;
57613 assert( pCur->iPage>0 );
57614 assert( pCur->apPage[pCur->iPage] );
57616 pCur->apPage[pCur->iPage-1],
57617 pCur->aiIdx[pCur->iPage-1],
57618 pCur->apPage[pCur->iPage]->pgno
57620 testcase( pCur->aiIdx[pCur->iPage-1] > pCur->apPage[pCur->iPage-1]->nCell );
57622 releasePage(pCur->apPage[pCur->iPage]);
57623 pCur->iPage--;
57665 if( pCur->iPage>=0 ){
57666 while( pCur->iPage ) releasePage(pCur->apPage[pCur->iPage--]);
57677 pCur->iPage = 0;
57729 while( rc==SQLITE_OK && !(pPage = pCur->apPage[pCur->iPage])->leaf ){
57730 assert( pCur->aiIdx[pCur->iPage]<pPage->nCell );
57731 pgno = get4byte(findCell(pPage, pCur->aiIdx[pCur->iPage]));
57754 while( !(pPage = pCur->apPage[pCur->iPage])->leaf ){
57756 pCur->aiIdx[pCur->iPage] = pPage->nCell;
57760 pCur->aiIdx[pCur->iPage] = pPage->nCell-1;
57778 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
57781 assert( pCur->apPage[pCur->iPage]->nCell>0 );
57805 for(ii=0; ii<pCur->iPage; ii++){
57808 assert( pCur->aiIdx[pCur->iPage]==pCur->apPage[pCur->iPage]->nCell-1 );
57809 assert( pCur->apPage[pCur->iPage]->leaf );
57817 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
57907 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage] );
57908 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->isInit );
57909 assert( pCur->eState==CURSOR_INVALID || pCur->apPage[pCur->iPage]->nCell>0 );
57912 assert( pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0 );
57919 MemPage *pPage = pCur->apPage[pCur->iPage];
57934 pCur->aiIdx[pCur->iPage] = (u16)idx;
57955 pCur->aiIdx[pCur->iPage] = (u16)idx;
58009 pCur->aiIdx[pCur->iPage] = (u16)idx;
58030 pCur->aiIdx[pCur->iPage] = (u16)idx;
58042 assert( pCur->aiIdx[pCur->iPage]<pCur->apPage[pCur->iPage]->nCell );
58043 pCur->aiIdx[pCur->iPage] = (u16)idx;
58054 pCur->aiIdx[pCur->iPage] = (u16)lwr;
58130 pPage = pCur->apPage[pCur->iPage];
58131 idx = ++pCur->aiIdx[pCur->iPage];
58148 if( pCur->iPage==0 ){
58154 pPage = pCur->apPage[pCur->iPage];
58155 }while( pCur->aiIdx[pCur->iPage]>=pPage->nCell );
58178 pPage = pCur->apPage[pCur->iPage];
58179 if( (++pCur->aiIdx[pCur->iPage])>=pPage->nCell ){
58180 pCur->aiIdx[pCur->iPage]--;
58241 pPage = pCur->apPage[pCur->iPage];
58244 int idx = pCur->aiIdx[pCur->iPage];
58249 while( pCur->aiIdx[pCur->iPage]==0 ){
58250 if( pCur->iPage==0 ){
58260 pCur->aiIdx[pCur->iPage]--;
58261 pPage = pCur->apPage[pCur->iPage];
58279 || pCur->aiIdx[pCur->iPage]==0
58280 || pCur->apPage[pCur->iPage]->leaf==0
58284 pCur->aiIdx[pCur->iPage]--;
58487 Pgno iPage;
58494 iPage = get4byte(&aData[8+i*4]);
58495 if( iPage<=nearby ){
58515 iPage = get4byte(&aData[8+closest*4]);
58516 testcase( iPage==mxPage );
58517 if( iPage>mxPage ){
58521 testcase( iPage==mxPage );
58523 || (iPage==nearby || (iPage<nearby && eMode==BTALLOC_LE))
58526 *pPgno = iPage;
58639 static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
58648 assert( iPage>1 );
58649 assert( !pMemPage || pMemPage->pgno==iPage );
58655 pPage = btreePageLookup(pBt, iPage);
58668 if( (!pPage && ((rc = btreeGetPage(pBt, iPage, &pPage, 0))!=0) )
58680 ptrmapPut(pBt, iPage, PTRMAP_FREEPAGE, 0, &rc);
58729 put4byte(&pTrunk->aData[8+nLeaf*4], iPage);
58733 rc = btreeSetHasContent(pBt, iPage);
58746 if( pPage==0 && SQLITE_OK!=(rc = btreeGetPage(pBt, iPage, &pPage, 0)) ){
58755 put4byte(&pPage1->aData[32], iPage);
60472 int iPage = pCur->iPage;
60473 MemPage *pPage = pCur->apPage[iPage];
60475 if( iPage==0 ){
60485 pCur->iPage = 1;
60496 MemPage * const pParent = pCur->apPage[iPage-1];
60497 int const iIdx = pCur->aiIdx[iPage-1];
60544 rc = balance_nonroot(pParent, iIdx, pSpace, iPage==1,
60565 pCur->iPage--;
60566 assert( pCur->iPage>=0 );
60669 pPage = pCur->apPage[pCur->iPage];
60683 idx = pCur->aiIdx[pCur->iPage];
60700 idx = ++pCur->aiIdx[pCur->iPage];
60736 pCur->apPage[pCur->iPage]->nOverflow = 0;
60739 assert( pCur->apPage[pCur->iPage]->nOverflow==0 );
60766 if( NEVER(pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell)
60772 iCellDepth = pCur->iPage;
60816 MemPage *pLeaf = pCur->apPage[pCur->iPage];
60848 if( rc==SQLITE_OK && pCur->iPage>iCellDepth ){
60849 while( pCur->iPage>iCellDepth ){
60850 releasePage(pCur->apPage[pCur->iPage--]);
61356 pPage = pCur->apPage[pCur->iPage];
61373 if( pCur->iPage==0 ){
61379 }while ( pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell );
61381 pCur->aiIdx[pCur->iPage]++;
61382 pPage = pCur->apPage[pCur->iPage];
61388 iIdx = pCur->aiIdx[pCur->iPage];
61467 static int checkRef(IntegrityCk *pCheck, Pgno iPage){
61468 if( iPage==0 ) return 1;
61469 if( iPage>pCheck->nPage ){
61470 checkAppendMsg(pCheck, "invalid page number %d", iPage);
61473 if( getPageReferenced(pCheck, iPage) ){
61474 checkAppendMsg(pCheck, "2nd reference to page %d", iPage);
61477 setPageReferenced(pCheck, iPage);
61519 int iPage, /* Page number for first page in the list */
61524 int iFirst = iPage;
61528 if( iPage<1 ){
61534 if( checkRef(pCheck, iPage) ) break;
61535 if( sqlite3PagerGet(pCheck->pPager, (Pgno)iPage, &pOvflPage) ){
61536 checkAppendMsg(pCheck, "failed to get page %d", iPage);
61544 checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0);
61549 "freelist leaf count too big on page %d", iPage);
61572 checkPtrmap(pCheck, i, PTRMAP_OVERFLOW2, iPage);
61576 iPage = get4byte(pOvflData);
61654 int iPage, /* Page number of the page to check */
61677 if( iPage==0 ) return 0;
61678 if( checkRef(pCheck, iPage) ) return 0;
61680 pCheck->v1 = iPage;
61681 if( (rc = btreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){
61711 pCheck->v1 = iPage;
61734 checkPtrmap(pCheck, pgnoOvfl, PTRMAP_OVERFLOW1, iPage);
61746 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
61760 pCheck->v1 = iPage;
61763 checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage);
61773 pCheck->v1 = iPage;
61837 "Corruption detected in cell %d on page %d",i,iPage);
61870 "Multiple uses for byte %u of page %d", x>>16, iPage);
61886 cnt, data[hdr+7], iPage);
62220 assert( pCsr->apPage[pCsr->iPage]->intKey );
62986 SQLITE_PRIVATE void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){
62990 if( !isFatalError(p->rc) && iPage<p->iNext ){
62998 rc = backupOnePage(p, iPage, aData, 1);
155322 int iPage; /* Current entry in aPage[] */
155480 pCsr->iPage = 0;
155666 pCsr->iPage = 0;
155675 StatPage *p = &pCsr->aPage[pCsr->iPage];
155710 if( pCsr->iPage==0 ) return statNext(pCursor);
155711 pCsr->iPage--;
155714 pCsr->iPage++;
155715 assert( p==&pCsr->aPage[pCsr->iPage-1] );
155735 StatPage *p = &pCsr->aPage[pCsr->iPage];