Lines Matching defs:pRoot

27609 ** on.  *pRoot is the list that i is a member of.
27611 static void memsys3UnlinkFromList(u32 i, u32 *pRoot){
27616 *pRoot = next;
27649 ** at *pRoot.
27651 static void memsys3LinkIntoList(u32 i, u32 *pRoot){
27653 mem3.aPool[i].u.list.next = *pRoot;
27655 if( *pRoot ){
27656 mem3.aPool[*pRoot].u.list.prev = i;
27658 *pRoot = i;
27764 ** *pRoot is the head of a list of free chunks of the same size
27765 ** or same size hash. In other words, *pRoot is an entry in either
27779 static void memsys3Merge(u32 *pRoot){
27783 for(i=*pRoot; i>0; i=iNext){
27788 memsys3UnlinkFromList(i, pRoot);
76025 MemPage *pRoot;
76041 pRoot = pCur->pPage = pCur->apPage[0];
76065 pRoot = pCur->pPage;
76066 assert( pRoot->pgno==pCur->pgnoRoot || CORRUPT_DB );
76076 ** in such a way that page pRoot is linked into a second b-tree table
76078 assert( pRoot->intKey==1 || pRoot->intKey==0 );
76079 if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
76088 if( pRoot->nCell>0 ){
76090 }else if( !pRoot->leaf ){
76092 if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
76093 subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
79477 static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
79481 BtShared *pBt = pRoot->pBt; /* The BTree */
79483 assert( pRoot->nOverflow>0 );
79486 /* Make pRoot, the root page of the b-tree, writable. Allocate a new
79488 ** of the node stored on pRoot into the new child page.
79490 rc = sqlite3PagerWrite(pRoot->pDbPage);
79492 rc = allocateBtreePage(pBt,&pChild,&pgnoChild,pRoot->pgno,0);
79493 copyNodeContent(pRoot, pChild, &rc);
79495 ptrmapPut(pBt, pgnoChild, PTRMAP_BTREE, pRoot->pgno, &rc);
79504 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
79505 assert( pChild->nCell==pRoot->nCell || CORRUPT_DB );
79507 TRACE(("BALANCE: copy root %u into %u\n", pRoot->pgno, pChild->pgno));
79509 /* Copy the overflow cells from pRoot to pChild */
79510 memcpy(pChild->aiOvfl, pRoot->aiOvfl,
79511 pRoot->nOverflow*sizeof(pRoot->aiOvfl[0]));
79512 memcpy(pChild->apOvfl, pRoot->apOvfl,
79513 pRoot->nOverflow*sizeof(pRoot->apOvfl[0]));
79514 pChild->nOverflow = pRoot->nOverflow;
79516 /* Zero the contents of pRoot. Then install pChild as the right-child. */
79517 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF);
79518 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild);
80484 MemPage *pRoot;
80494 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
80558 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
80567 releasePage(pRoot);
80572 rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0);
80573 releasePage(pRoot);
80579 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
80583 rc = sqlite3PagerWrite(pRoot->pDbPage);
80585 releasePage(pRoot);
80589 pRoot = pPageMove;
80595 releasePage(pRoot);
80606 releasePage(pRoot);
80611 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
80615 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
80621 zeroPage(pRoot, ptfFlags);
80622 sqlite3PagerUnref(pRoot->pDbPage);
105159 ** pRoot is the root of an incremental merge-tree with depth nDepth (according
105170 MergeEngine *pRoot, /* Root of tree */
105176 MergeEngine *p = pRoot;
105245 MergeEngine *pRoot = 0; /* Root node of tree for this task */
105250 rc = vdbeMergeEngineLevel0(pTask, pTask->nPMA, &iReadOff, &pRoot);
105254 pRoot = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
105255 if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT;
105263 rc = vdbeSorterAddToTree(pTask, nDepth, iSeq++, pRoot, pMerger);
105271 rc = vdbeIncrMergerNew(pTask, pRoot, &pMain->aReadr[iTask].pIncr);
105276 pMain = pRoot;
105279 vdbeMergeEngineFree(pRoot);
109996 ** Attach subtrees pLeft and pRight to the Expr node pRoot.
109998 ** If pRoot==NULL that means that a memory allocation error has occurred.
110003 Expr *pRoot,
110007 if( pRoot==0 ){
110012 assert( ExprUseXList(pRoot) );
110013 assert( pRoot->x.pSelect==0 );
110015 pRoot->pRight = pRight;
110016 pRoot->flags |= EP_Propagate & pRight->flags;
110018 pRoot->nHeight = pRight->nHeight+1;
110020 pRoot->nHeight = 1;
110024 pRoot->pLeft = pLeft;
110025 pRoot->flags |= EP_Propagate & pLeft->flags;
110027 if( pLeft->nHeight>=pRoot->nHeight ){
110028 pRoot->nHeight = pLeft->nHeight+1;
153062 Parse *pRoot = sqlite3ParseToplevel(pParse);
153071 for(pPrg=pRoot->pTriggerPrg;
191069 ** Fts3TokenAndCost.pRoot.
191076 Fts3Expr *pRoot; /* Root of NEAR/AND cluster */
191090 Fts3Expr *pRoot, /* Root of current AND/NEAR cluster */
191104 pTC->pRoot = pRoot;
191116 pRoot = pExpr->pLeft;
191117 **ppOr = pRoot;
191120 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pLeft, ppTC, ppOr, pRc);
191122 pRoot = pExpr->pRight;
191123 **ppOr = pRoot;
191126 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pRight, ppTC, ppOr, pRc);
191196 ** the cluster with root node pRoot. See comments above the definition
191205 Fts3Expr *pRoot, /* Consider tokens with this root node */
191232 if( aTC[ii].pRoot==pRoot ){
191272 if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
192010 Fts3Expr *pRoot; /* Root of NEAR expression */
192017 pRoot = pExpr;
192018 while( pRoot->pParent
192019 && (pRoot->pParent->eType==FTSQUERY_NEAR || pRoot->bDeferred)
192021 pRoot = pRoot->pParent;
192023 iDocid = pRoot->iDocid;
192024 bEof = pRoot->bEof;
192025 assert( pRoot->bStart );
192028 rc = sqlite3Fts3ExprIterate(pRoot, fts3AllocateMSI, (void*)pTab);
192030 fts3EvalRestart(pCsr, pRoot, &rc);
192040 fts3EvalNextRow(pCsr, pRoot, &rc);
192041 pCsr->isEof = pRoot->bEof;
192044 pCsr->iPrevId = pRoot->iDocid;
192046 && pRoot->eType==FTSQUERY_NEAR
192051 fts3EvalUpdateCounts(pRoot, pTab->nColumn);
192059 pRoot->bEof = bEof;
192061 /* Caution: pRoot may iterate through docids in ascending or descending
192065 ** do {...} while( pRoot->iDocid<iDocid && rc==SQLITE_OK );
192067 fts3EvalRestart(pCsr, pRoot, &rc);
192069 fts3EvalNextRow(pCsr, pRoot, &rc);
192070 assert_fts3_nc( pRoot->bEof==0 );
192071 if( pRoot->bEof ) rc = FTS_CORRUPT_VTAB;
192072 }while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
193691 Fts3Expr *pRoot = *pp; /* Initial root node */
193693 int eType = pRoot->eType; /* Type of node in this tree */
193714 for(p=pRoot; p->eType==eType; p=p->pLeft){
193729 pRoot = 0;
193769 assert( pParent==pRoot );
193770 pRoot = pParent->pRight;
193799 pRoot = p;
193803 ** sqlite3Fts3ExprFree(pRoot) below. */
193818 Fts3Expr *pLeft = pRoot->pLeft;
193819 Fts3Expr *pRight = pRoot->pRight;
193821 pRoot->pLeft = 0;
193822 pRoot->pRight = 0;
193836 pRoot->pLeft = pLeft;
193837 pLeft->pParent = pRoot;
193838 pRoot->pRight = pRight;
193839 pRight->pParent = pRoot;
193845 sqlite3Fts3ExprFree(pRoot);
193846 pRoot = 0;
193848 *pp = pRoot;
200585 NodeWriter *pRoot; /* NodeWriter for root node */
200630 pRoot = &pWriter->aNodeWriter[iRoot];
200651 pRoot->block.a, pRoot->block.n /* root */
200654 sqlite3_free(pRoot->block.a);
200655 sqlite3_free(pRoot->key.a);
212169 RtreeNode *pRoot = 0;
212212 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
212283 pCsr->aNode[0] = pRoot;
212284 pRoot = 0;
212290 nodeRelease(pRtree, pRoot);
213233 RtreeNode *pRoot = 0; /* Root node of rtree structure */
213237 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
213278 if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){
213281 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
213282 rc = nodeAcquire(pRtree, iChild, pRoot, &pChild); /* tag-20210916a */
213290 writeInt16(pRoot->zData, pRtree->iDepth);
213291 pRoot->isDirty = 1;
213307 rc = nodeRelease(pRtree, pRoot);
213309 nodeRelease(pRtree, pRoot);
215971 RtreeNode *pRoot = 0;
216005 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
216070 pCsr->aNode[0] = pRoot;
216071 pRoot = 0;
216078 nodeRelease(pRtree, pRoot);
236719 Fts5ExprNode *pRoot;
236978 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
236979 if( pNew->pRoot ){
236980 pNew->pRoot->bEof = 1;
236983 pNew->pRoot = sParse.pExpr;
237113 sqlite3Fts5ParseNodeFree(p->pRoot);
237127 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
237128 p2->pRoot = 0;
238039 if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
238215 Fts5ExprNode *pRoot = p->pRoot;
238220 rc = fts5ExprNodeFirst(p, pRoot);
238225 && 0==pRoot->bEof
238226 && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0
238228 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
238232 while( pRoot->bNomatch && rc==SQLITE_OK ){
238233 assert( pRoot->bEof==0 );
238234 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
238247 Fts5ExprNode *pRoot = p->pRoot;
238248 assert( pRoot->bEof==0 && pRoot->bNomatch==0 );
238250 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
238251 assert( pRoot->bNomatch==0 || (rc==SQLITE_OK && pRoot->bEof==0) );
238252 }while( pRoot->bNomatch );
238253 if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){
238254 pRoot->bEof = 1;
238260 return p->pRoot->bEof;
238264 return p->pRoot->iRowid;
238578 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc,
238582 pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
238595 pNew->pRoot->pNear->pColset = pColset;
238628 pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase;
238629 pNew->pRoot->pNear->nPhrase = 1;
238630 sCtx.pPhrase->pNode = pNew->pRoot;
238636 pNew->pRoot->eType = FTS5_TERM;
238637 pNew->pRoot->xNext = fts5ExprNodeNext_TERM;
238639 pNew->pRoot->eType = FTS5_STRING;
238640 pNew->pRoot->xNext = fts5ExprNodeNext_STRING;
239459 if( pExpr->pRoot->xNext==0 ){
239462 zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot);
239464 zText = fts5ExprPrint(pConfig, pExpr->pRoot);
239608 if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
239644 (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
239696 i64 iRowid = pExpr->pRoot->iRowid;
239816 fts5ExprCheckPoslists(pExpr->pRoot, iRowid);
239836 && pNode->iRowid==pExpr->pRoot->iRowid