Lines Matching refs:pRoot
28110 static void memsys3UnlinkFromList(u32 i, u32 *pRoot){ in memsys3UnlinkFromList() argument
28115 *pRoot = next; in memsys3UnlinkFromList()
28150 static void memsys3LinkIntoList(u32 i, u32 *pRoot){ in memsys3LinkIntoList() argument
28152 mem3.aPool[i].u.list.next = *pRoot; in memsys3LinkIntoList()
28154 if( *pRoot ){ in memsys3LinkIntoList()
28155 mem3.aPool[*pRoot].u.list.prev = i; in memsys3LinkIntoList()
28157 *pRoot = i; in memsys3LinkIntoList()
28278 static void memsys3Merge(u32 *pRoot){ in memsys3Merge() argument
28282 for(i=*pRoot; i>0; i=iNext){ in memsys3Merge()
28287 memsys3UnlinkFromList(i, pRoot); in memsys3Merge()
77067 MemPage *pRoot; local
77083 pRoot = pCur->pPage = pCur->apPage[0];
77107 pRoot = pCur->pPage;
77108 assert( pRoot->pgno==pCur->pgnoRoot || CORRUPT_DB );
77120 assert( pRoot->intKey==1 || pRoot->intKey==0 );
77121 if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
77130 if( pRoot->nCell>0 ){
77132 }else if( !pRoot->leaf ){
77134 if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
77135 subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
80530 static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
80534 BtShared *pBt = pRoot->pBt; /* The BTree */
80536 assert( pRoot->nOverflow>0 );
80543 rc = sqlite3PagerWrite(pRoot->pDbPage);
80545 rc = allocateBtreePage(pBt,&pChild,&pgnoChild,pRoot->pgno,0);
80546 copyNodeContent(pRoot, pChild, &rc);
80548 ptrmapPut(pBt, pgnoChild, PTRMAP_BTREE, pRoot->pgno, &rc);
80557 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
80558 assert( pChild->nCell==pRoot->nCell || CORRUPT_DB );
80560 TRACE(("BALANCE: copy root %u into %u\n", pRoot->pgno, pChild->pgno));
80563 memcpy(pChild->aiOvfl, pRoot->aiOvfl,
80564 pRoot->nOverflow*sizeof(pRoot->aiOvfl[0]));
80565 memcpy(pChild->apOvfl, pRoot->apOvfl,
80566 pRoot->nOverflow*sizeof(pRoot->apOvfl[0]));
80567 pChild->nOverflow = pRoot->nOverflow;
80570 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF);
80571 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild);
81537 MemPage *pRoot; local
81547 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
81611 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
81620 releasePage(pRoot);
81625 rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0);
81626 releasePage(pRoot);
81632 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
81636 rc = sqlite3PagerWrite(pRoot->pDbPage);
81638 releasePage(pRoot);
81642 pRoot = pPageMove;
81648 releasePage(pRoot);
81659 releasePage(pRoot);
81664 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
81668 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
81674 zeroPage(pRoot, ptfFlags);
81675 sqlite3PagerUnref(pRoot->pDbPage);
106478 MergeEngine *pRoot, /* Root of tree */
106484 MergeEngine *p = pRoot;
106553 MergeEngine *pRoot = 0; /* Root node of tree for this task */
106558 rc = vdbeMergeEngineLevel0(pTask, pTask->nPMA, &iReadOff, &pRoot);
106562 pRoot = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
106563 if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT;
106571 rc = vdbeSorterAddToTree(pTask, nDepth, iSeq++, pRoot, pMerger);
106579 rc = vdbeIncrMergerNew(pTask, pRoot, &pMain->aReadr[iTask].pIncr);
106584 pMain = pRoot;
106587 vdbeMergeEngineFree(pRoot);
111343 Expr *pRoot,
111347 if( pRoot==0 ){
111352 assert( ExprUseXList(pRoot) );
111353 assert( pRoot->x.pSelect==0 );
111355 pRoot->pRight = pRight;
111356 pRoot->flags |= EP_Propagate & pRight->flags;
111358 pRoot->nHeight = pRight->nHeight+1;
111360 pRoot->nHeight = 1;
111364 pRoot->pLeft = pLeft;
111365 pRoot->flags |= EP_Propagate & pLeft->flags;
111367 if( pLeft->nHeight>=pRoot->nHeight ){
111368 pRoot->nHeight = pLeft->nHeight+1;
155224 Parse *pRoot = sqlite3ParseToplevel(pParse);
155233 for(pPrg=pRoot->pTriggerPrg;
194006 Fts3Expr *pRoot; /* Root of NEAR/AND cluster */
194020 Fts3Expr *pRoot, /* Root of current AND/NEAR cluster */
194034 pTC->pRoot = pRoot;
194046 pRoot = pExpr->pLeft;
194047 **ppOr = pRoot;
194050 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pLeft, ppTC, ppOr, pRc);
194052 pRoot = pExpr->pRight;
194053 **ppOr = pRoot;
194056 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pRight, ppTC, ppOr, pRc);
194135 Fts3Expr *pRoot, /* Consider tokens with this root node */
194162 if( aTC[ii].pRoot==pRoot ){
194202 if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
194958 Fts3Expr *pRoot; /* Root of NEAR expression */
194965 pRoot = pExpr;
194966 while( pRoot->pParent
194967 && (pRoot->pParent->eType==FTSQUERY_NEAR || pRoot->bDeferred)
194969 pRoot = pRoot->pParent;
194971 iDocid = pRoot->iDocid;
194972 bEof = pRoot->bEof;
194973 assert( pRoot->bStart );
194976 rc = sqlite3Fts3ExprIterate(pRoot, fts3AllocateMSI, (void*)pTab);
194978 fts3EvalRestart(pCsr, pRoot, &rc);
194988 fts3EvalNextRow(pCsr, pRoot, &rc);
194989 pCsr->isEof = pRoot->bEof;
194992 pCsr->iPrevId = pRoot->iDocid;
194994 && pRoot->eType==FTSQUERY_NEAR
194999 fts3EvalUpdateCounts(pRoot, pTab->nColumn);
195007 pRoot->bEof = bEof;
195015 fts3EvalRestart(pCsr, pRoot, &rc);
195017 fts3EvalNextRow(pCsr, pRoot, &rc);
195018 assert_fts3_nc( pRoot->bEof==0 );
195019 if( pRoot->bEof ) rc = FTS_CORRUPT_VTAB;
195020 }while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
196663 Fts3Expr *pRoot = *pp; /* Initial root node */
196665 int eType = pRoot->eType; /* Type of node in this tree */
196686 for(p=pRoot; p->eType==eType; p=p->pLeft){
196701 pRoot = 0;
196741 assert( pParent==pRoot );
196742 pRoot = pParent->pRight;
196771 pRoot = p;
196790 Fts3Expr *pLeft = pRoot->pLeft;
196791 Fts3Expr *pRight = pRoot->pRight;
196793 pRoot->pLeft = 0;
196794 pRoot->pRight = 0;
196808 pRoot->pLeft = pLeft;
196809 pLeft->pParent = pRoot;
196810 pRoot->pRight = pRight;
196811 pRight->pParent = pRoot;
196817 sqlite3Fts3ExprFree(pRoot);
196818 pRoot = 0;
196820 *pp = pRoot;
203552 NodeWriter *pRoot; /* NodeWriter for root node */
203597 pRoot = &pWriter->aNodeWriter[iRoot];
203618 pRoot->block.a, pRoot->block.n /* root */
203621 sqlite3_free(pRoot->block.a);
203622 sqlite3_free(pRoot->key.a);
215325 RtreeNode *pRoot = 0;
215368 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
215439 pCsr->aNode[0] = pRoot;
215440 pRoot = 0;
215446 nodeRelease(pRtree, pRoot);
216389 RtreeNode *pRoot = 0; /* Root node of rtree structure */
216393 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
216434 if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){
216437 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
216438 rc = nodeAcquire(pRtree, iChild, pRoot, &pChild); /* tag-20210916a */
216446 writeInt16(pRoot->zData, pRtree->iDepth);
216447 pRoot->isDirty = 1;
216463 rc = nodeRelease(pRtree, pRoot);
216465 nodeRelease(pRtree, pRoot);
219127 RtreeNode *pRoot = 0;
219161 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
219226 pCsr->aNode[0] = pRoot;
219227 pRoot = 0;
219234 nodeRelease(pRtree, pRoot);
240434 Fts5ExprNode *pRoot;
240707 pNew->pRoot = sParse.pExpr;
240836 sqlite3Fts5ParseNodeFree(p->pRoot);
240850 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
240851 p2->pRoot = 0;
241762 if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
241938 Fts5ExprNode *pRoot = p->pRoot;
241943 rc = fts5ExprNodeFirst(p, pRoot);
241948 && 0==pRoot->bEof
241949 && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0
241951 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
241955 while( pRoot->bNomatch && rc==SQLITE_OK ){
241956 assert( pRoot->bEof==0 );
241957 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
241970 Fts5ExprNode *pRoot = p->pRoot;
241971 assert( pRoot->bEof==0 && pRoot->bNomatch==0 );
241973 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
241974 assert( pRoot->bNomatch==0 || (rc==SQLITE_OK && pRoot->bEof==0) );
241975 }while( pRoot->bNomatch );
241976 if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){
241977 pRoot->bEof = 1;
241983 return p->pRoot->bEof;
241987 return p->pRoot->iRowid;
242299 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, SZ_FTS5EXPRNODE(1));
242302 pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
242315 pNew->pRoot->pNear->pColset = pColset;
242348 pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase;
242349 pNew->pRoot->pNear->nPhrase = 1;
242350 sCtx.pPhrase->pNode = pNew->pRoot;
242356 pNew->pRoot->eType = FTS5_TERM;
242357 pNew->pRoot->xNext = fts5ExprNodeNext_TERM;
242359 pNew->pRoot->eType = FTS5_STRING;
242360 pNew->pRoot->xNext = fts5ExprNodeNext_STRING;
243189 if( pExpr->pRoot->xNext==0 ){
243192 zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot);
243194 zText = fts5ExprPrint(pConfig, pExpr->pRoot);
243338 if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
243374 (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
243426 i64 iRowid = pExpr->pRoot->iRowid;
243547 fts5ExprCheckPoslists(pExpr->pRoot, iRowid);
243567 && pNode->iRowid==pExpr->pRoot->iRowid