Lines Matching refs:pRoot

24467 static void memsys3UnlinkFromList(u32 i, u32 *pRoot){  in memsys3UnlinkFromList()  argument
24472 *pRoot = next; in memsys3UnlinkFromList()
24507 static void memsys3LinkIntoList(u32 i, u32 *pRoot){ in memsys3LinkIntoList() argument
24509 mem3.aPool[i].u.list.next = *pRoot; in memsys3LinkIntoList()
24511 if( *pRoot ){ in memsys3LinkIntoList()
24512 mem3.aPool[*pRoot].u.list.prev = i; in memsys3LinkIntoList()
24514 *pRoot = i; in memsys3LinkIntoList()
24635 static void memsys3Merge(u32 *pRoot){ in memsys3Merge() argument
24639 for(i=*pRoot; i>0; i=iNext){ in memsys3Merge()
24644 memsys3UnlinkFromList(i, pRoot); in memsys3Merge()
69509 MemPage *pRoot;
69549 pRoot = pCur->pPage;
69550 assert( pRoot->pgno==pCur->pgnoRoot );
69562 assert( pRoot->intKey==1 || pRoot->intKey==0 );
69563 if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
69572 pRoot = pCur->pPage;
69573 if( pRoot->nCell>0 ){
69575 }else if( !pRoot->leaf ){
69577 if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
69578 subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
72623 static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
72627 BtShared *pBt = pRoot->pBt; /* The BTree */
72629 assert( pRoot->nOverflow>0 );
72636 rc = sqlite3PagerWrite(pRoot->pDbPage);
72638 rc = allocateBtreePage(pBt,&pChild,&pgnoChild,pRoot->pgno,0);
72639 copyNodeContent(pRoot, pChild, &rc);
72641 ptrmapPut(pBt, pgnoChild, PTRMAP_BTREE, pRoot->pgno, &rc);
72650 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
72651 assert( pChild->nCell==pRoot->nCell || CORRUPT_DB );
72653 TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno));
72656 memcpy(pChild->aiOvfl, pRoot->aiOvfl,
72657 pRoot->nOverflow*sizeof(pRoot->aiOvfl[0]));
72658 memcpy(pChild->apOvfl, pRoot->apOvfl,
72659 pRoot->nOverflow*sizeof(pRoot->apOvfl[0]));
72660 pChild->nOverflow = pRoot->nOverflow;
72663 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF);
72664 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild);
73419 MemPage *pRoot;
73429 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
73491 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
73500 releasePage(pRoot);
73505 rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0);
73506 releasePage(pRoot);
73512 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
73516 rc = sqlite3PagerWrite(pRoot->pDbPage);
73518 releasePage(pRoot);
73522 pRoot = pPageMove;
73528 releasePage(pRoot);
73539 releasePage(pRoot);
73544 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
73548 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
73554 zeroPage(pRoot, ptfFlags);
73555 sqlite3PagerUnref(pRoot->pDbPage);
96020 MergeEngine *pRoot, /* Root of tree */
96026 MergeEngine *p = pRoot;
96095 MergeEngine *pRoot = 0; /* Root node of tree for this task */
96100 rc = vdbeMergeEngineLevel0(pTask, pTask->nPMA, &iReadOff, &pRoot);
96104 pRoot = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
96105 if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT;
96113 rc = vdbeSorterAddToTree(pTask, nDepth, iSeq++, pRoot, pMerger);
96121 rc = vdbeIncrMergerNew(pTask, pRoot, &pMain->aReadr[iTask].pIncr);
96126 pMain = pRoot;
96129 vdbeMergeEngineFree(pRoot);
100346 Expr *pRoot,
100350 if( pRoot==0 ){
100356 pRoot->pRight = pRight;
100357 pRoot->flags |= EP_Propagate & pRight->flags;
100360 pRoot->pLeft = pLeft;
100361 pRoot->flags |= EP_Propagate & pLeft->flags;
100363 exprSetHeight(pRoot);
136850 Parse *pRoot = sqlite3ParseToplevel(pParse);
136859 for(pPrg=pRoot->pTriggerPrg;
170880 Fts3Expr *pRoot; /* Root of NEAR/AND cluster */
170894 Fts3Expr *pRoot, /* Root of current AND/NEAR cluster */
170908 pTC->pRoot = pRoot;
170920 pRoot = pExpr->pLeft;
170921 **ppOr = pRoot;
170924 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pLeft, ppTC, ppOr, pRc);
170926 pRoot = pExpr->pRight;
170927 **ppOr = pRoot;
170930 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pRight, ppTC, ppOr, pRc);
171009 Fts3Expr *pRoot, /* Consider tokens with this root node */
171036 if( aTC[ii].pRoot==pRoot ){
171076 if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
171796 Fts3Expr *pRoot; /* Root of NEAR expression */
171804 pRoot = pExpr;
171805 while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){
171806 pRoot = pRoot->pParent;
171808 iDocid = pRoot->iDocid;
171809 bEof = pRoot->bEof;
171810 assert( pRoot->bStart );
171813 for(p=pRoot; p; p=p->pLeft){
171821 fts3EvalRestart(pCsr, pRoot, &rc);
171831 fts3EvalNextRow(pCsr, pRoot, &rc);
171832 pCsr->isEof = pRoot->bEof;
171835 pCsr->iPrevId = pRoot->iDocid;
171837 && pRoot->eType==FTSQUERY_NEAR
171842 fts3EvalUpdateCounts(pRoot, pTab->nColumn);
171850 pRoot->bEof = bEof;
171858 fts3EvalRestart(pCsr, pRoot, &rc);
171860 fts3EvalNextRow(pCsr, pRoot, &rc);
171861 assert( pRoot->bEof==0 );
171862 }while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
173461 Fts3Expr *pRoot = *pp; /* Initial root node */
173463 int eType = pRoot->eType; /* Type of node in this tree */
173484 for(p=pRoot; p->eType==eType; p=p->pLeft){
173499 pRoot = 0;
173539 assert( pParent==pRoot );
173540 pRoot = pParent->pRight;
173569 pRoot = p;
173588 Fts3Expr *pLeft = pRoot->pLeft;
173589 Fts3Expr *pRight = pRoot->pRight;
173591 pRoot->pLeft = 0;
173592 pRoot->pRight = 0;
173606 pRoot->pLeft = pLeft;
173607 pLeft->pParent = pRoot;
173608 pRoot->pRight = pRight;
173609 pRight->pParent = pRoot;
173615 sqlite3Fts3ExprFree(pRoot);
173616 pRoot = 0;
173618 *pp = pRoot;
180315 NodeWriter *pRoot; /* NodeWriter for root node */
180360 pRoot = &pWriter->aNodeWriter[iRoot];
180381 pRoot->block.a, pRoot->block.n /* root */
180384 sqlite3_free(pRoot->block.a);
180385 sqlite3_free(pRoot->key.a);
185683 JsonNode *pRoot = &pParse->aNode[iRoot];
185684 if( zPath[0]==0 ) return pRoot;
185685 if( pRoot->jnFlags & JNODE_REPLACE ) return 0;
185687 if( pRoot->eType!=JSON_OBJECT ) return 0;
185710 while( j<=pRoot->n ){
185711 if( jsonLabelCompare(pRoot+j, zKey, nKey) ){
185715 j += jsonNodeSize(&pRoot[j]);
185717 if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
185718 iRoot += pRoot->u.iAppend;
185719 pRoot = &pParse->aNode[iRoot];
185731 pRoot = &pParse->aNode[iRoot];
185732 pRoot->u.iAppend = iStart - iRoot;
185733 pRoot->jnFlags |= JNODE_APPEND;
185747 JsonNode *pBase = pRoot;
185749 if( pRoot->eType!=JSON_ARRAY ) return 0;
185780 if( pRoot->eType!=JSON_ARRAY ) return 0;
185784 while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){
185785 if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--;
185786 j += jsonNodeSize(&pRoot[j]);
185788 if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
185789 iRoot += pRoot->u.iAppend;
185790 pRoot = &pParse->aNode[iRoot];
185793 if( j<=pRoot->n ){
185803 pRoot = &pParse->aNode[iRoot];
185804 pRoot->u.iAppend = iStart - iRoot;
185805 pRoot->jnFlags |= JNODE_APPEND;
188992 RtreeNode *pRoot = 0;
189034 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
189089 pCsr->aNode[0] = pRoot;
189090 pRoot = 0;
189096 nodeRelease(pRtree, pRoot);
190192 RtreeNode *pRoot = 0; /* Root node of rtree structure */
190196 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
190237 if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){
190240 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
190241 rc = nodeAcquire(pRtree, iChild, pRoot, &pChild);
190249 writeInt16(pRoot->zData, pRtree->iDepth);
190250 pRoot->isDirty = 1;
190266 rc = nodeRelease(pRtree, pRoot);
190268 nodeRelease(pRtree, pRoot);
192884 RtreeNode *pRoot = 0;
192917 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
192981 pCsr->aNode[0] = pRoot;
192982 pRoot = 0;
192989 nodeRelease(pRtree, pRoot);
212044 Fts5ExprNode *pRoot;
212264 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
212265 if( pNew->pRoot ){
212266 pNew->pRoot->bEof = 1;
212269 pNew->pRoot = sParse.pExpr;
212305 sqlite3Fts5ParseNodeFree(p->pRoot);
212319 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
212320 p2->pRoot = 0;
213230 if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
213406 Fts5ExprNode *pRoot = p->pRoot;
213411 rc = fts5ExprNodeFirst(p, pRoot);
213416 && 0==pRoot->bEof
213417 && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0
213419 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
213423 while( pRoot->bNomatch ){
213424 assert( pRoot->bEof==0 && rc==SQLITE_OK );
213425 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
213438 Fts5ExprNode *pRoot = p->pRoot;
213439 assert( pRoot->bEof==0 && pRoot->bNomatch==0 );
213441 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
213442 assert( pRoot->bNomatch==0 || (rc==SQLITE_OK && pRoot->bEof==0) );
213443 }while( pRoot->bNomatch );
213444 if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){
213445 pRoot->bEof = 1;
213451 return p->pRoot->bEof;
213455 return p->pRoot->iRowid;
213746 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc,
213750 pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
213763 pNew->pRoot->pNear->pColset = pColset;
213795 pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase;
213796 pNew->pRoot->pNear->nPhrase = 1;
213797 sCtx.pPhrase->pNode = pNew->pRoot;
213803 pNew->pRoot->eType = FTS5_TERM;
213804 pNew->pRoot->xNext = fts5ExprNodeNext_TERM;
213806 pNew->pRoot->eType = FTS5_STRING;
213807 pNew->pRoot->xNext = fts5ExprNodeNext_STRING;
214531 if( pExpr->pRoot->xNext==0 ){
214534 zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot);
214536 zText = fts5ExprPrint(pConfig, pExpr->pRoot);
214674 if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
214701 (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
214851 fts5ExprCheckPoslists(pExpr->pRoot, iRowid);
214871 && pNode->iRowid==pExpr->pRoot->iRowid