Lines Matching defs:pRoot
26435 ** on. *pRoot is the list that i is a member of.
26437 static void memsys3UnlinkFromList(u32 i, u32 *pRoot){
26442 *pRoot = next;
26475 ** at *pRoot.
26477 static void memsys3LinkIntoList(u32 i, u32 *pRoot){
26479 mem3.aPool[i].u.list.next = *pRoot;
26481 if( *pRoot ){
26482 mem3.aPool[*pRoot].u.list.prev = i;
26484 *pRoot = i;
26590 ** *pRoot is the head of a list of free chunks of the same size
26591 ** or same size hash. In other words, *pRoot is an entry in either
26605 static void memsys3Merge(u32 *pRoot){
26609 for(i=*pRoot; i>0; i=iNext){
26614 memsys3UnlinkFromList(i, pRoot);
73983 MemPage *pRoot;
73999 pRoot = pCur->pPage = pCur->apPage[0];
74023 pRoot = pCur->pPage;
74024 assert( pRoot->pgno==pCur->pgnoRoot || CORRUPT_DB );
74034 ** in such a way that page pRoot is linked into a second b-tree table
74036 assert( pRoot->intKey==1 || pRoot->intKey==0 );
74037 if( pRoot->isInit==0 || (pCur->pKeyInfo==0)!=pRoot->intKey ){
74046 if( pRoot->nCell>0 ){
74048 }else if( !pRoot->leaf ){
74050 if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
74051 subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
77291 static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
77295 BtShared *pBt = pRoot->pBt; /* The BTree */
77297 assert( pRoot->nOverflow>0 );
77300 /* Make pRoot, the root page of the b-tree, writable. Allocate a new
77302 ** of the node stored on pRoot into the new child page.
77304 rc = sqlite3PagerWrite(pRoot->pDbPage);
77306 rc = allocateBtreePage(pBt,&pChild,&pgnoChild,pRoot->pgno,0);
77307 copyNodeContent(pRoot, pChild, &rc);
77309 ptrmapPut(pBt, pgnoChild, PTRMAP_BTREE, pRoot->pgno, &rc);
77318 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
77319 assert( pChild->nCell==pRoot->nCell || CORRUPT_DB );
77321 TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno));
77323 /* Copy the overflow cells from pRoot to pChild */
77324 memcpy(pChild->aiOvfl, pRoot->aiOvfl,
77325 pRoot->nOverflow*sizeof(pRoot->aiOvfl[0]));
77326 memcpy(pChild->apOvfl, pRoot->apOvfl,
77327 pRoot->nOverflow*sizeof(pRoot->apOvfl[0]));
77328 pChild->nOverflow = pRoot->nOverflow;
77330 /* Zero the contents of pRoot. Then install pChild as the right-child. */
77331 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF);
77332 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild);
78268 MemPage *pRoot;
78278 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
78342 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
78351 releasePage(pRoot);
78356 rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0);
78357 releasePage(pRoot);
78363 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
78367 rc = sqlite3PagerWrite(pRoot->pDbPage);
78369 releasePage(pRoot);
78373 pRoot = pPageMove;
78379 releasePage(pRoot);
78390 releasePage(pRoot);
78395 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
78399 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
78405 zeroPage(pRoot, ptfFlags);
78406 sqlite3PagerUnref(pRoot->pDbPage);
102134 ** pRoot is the root of an incremental merge-tree with depth nDepth (according
102145 MergeEngine *pRoot, /* Root of tree */
102151 MergeEngine *p = pRoot;
102220 MergeEngine *pRoot = 0; /* Root node of tree for this task */
102225 rc = vdbeMergeEngineLevel0(pTask, pTask->nPMA, &iReadOff, &pRoot);
102229 pRoot = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
102230 if( pRoot==0 ) rc = SQLITE_NOMEM_BKPT;
102238 rc = vdbeSorterAddToTree(pTask, nDepth, iSeq++, pRoot, pMerger);
102246 rc = vdbeIncrMergerNew(pTask, pRoot, &pMain->aReadr[iTask].pIncr);
102251 pMain = pRoot;
102254 vdbeMergeEngineFree(pRoot);
106711 ** Attach subtrees pLeft and pRight to the Expr node pRoot.
106713 ** If pRoot==NULL that means that a memory allocation error has occurred.
106718 Expr *pRoot,
106722 if( pRoot==0 ){
106727 assert( ExprUseXList(pRoot) );
106728 assert( pRoot->x.pSelect==0 );
106730 pRoot->pRight = pRight;
106731 pRoot->flags |= EP_Propagate & pRight->flags;
106733 pRoot->nHeight = pRight->nHeight+1;
106735 pRoot->nHeight = 1;
106739 pRoot->pLeft = pLeft;
106740 pRoot->flags |= EP_Propagate & pLeft->flags;
106742 if( pLeft->nHeight>=pRoot->nHeight ){
106743 pRoot->nHeight = pLeft->nHeight+1;
147632 Parse *pRoot = sqlite3ParseToplevel(pParse);
147641 for(pPrg=pRoot->pTriggerPrg;
184503 ** Fts3TokenAndCost.pRoot.
184510 Fts3Expr *pRoot; /* Root of NEAR/AND cluster */
184524 Fts3Expr *pRoot, /* Root of current AND/NEAR cluster */
184538 pTC->pRoot = pRoot;
184550 pRoot = pExpr->pLeft;
184551 **ppOr = pRoot;
184554 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pLeft, ppTC, ppOr, pRc);
184556 pRoot = pExpr->pRight;
184557 **ppOr = pRoot;
184560 fts3EvalTokenCosts(pCsr, pRoot, pExpr->pRight, ppTC, ppOr, pRc);
184630 ** the cluster with root node pRoot. See comments above the definition
184639 Fts3Expr *pRoot, /* Consider tokens with this root node */
184666 if( aTC[ii].pRoot==pRoot ){
184706 if( aTC[iTC].pToken && aTC[iTC].pRoot==pRoot
185429 Fts3Expr *pRoot; /* Root of NEAR expression */
185437 pRoot = pExpr;
185438 while( pRoot->pParent && pRoot->pParent->eType==FTSQUERY_NEAR ){
185439 pRoot = pRoot->pParent;
185441 iDocid = pRoot->iDocid;
185442 bEof = pRoot->bEof;
185443 assert( pRoot->bStart );
185446 for(p=pRoot; p; p=p->pLeft){
185454 fts3EvalRestart(pCsr, pRoot, &rc);
185464 fts3EvalNextRow(pCsr, pRoot, &rc);
185465 pCsr->isEof = pRoot->bEof;
185468 pCsr->iPrevId = pRoot->iDocid;
185470 && pRoot->eType==FTSQUERY_NEAR
185475 fts3EvalUpdateCounts(pRoot, pTab->nColumn);
185483 pRoot->bEof = bEof;
185485 /* Caution: pRoot may iterate through docids in ascending or descending
185489 ** do {...} while( pRoot->iDocid<iDocid && rc==SQLITE_OK );
185491 fts3EvalRestart(pCsr, pRoot, &rc);
185493 fts3EvalNextRow(pCsr, pRoot, &rc);
185494 assert_fts3_nc( pRoot->bEof==0 );
185495 if( pRoot->bEof ) rc = FTS_CORRUPT_VTAB;
185496 }while( pRoot->iDocid!=iDocid && rc==SQLITE_OK );
187108 Fts3Expr *pRoot = *pp; /* Initial root node */
187110 int eType = pRoot->eType; /* Type of node in this tree */
187131 for(p=pRoot; p->eType==eType; p=p->pLeft){
187146 pRoot = 0;
187186 assert( pParent==pRoot );
187187 pRoot = pParent->pRight;
187216 pRoot = p;
187220 ** sqlite3Fts3ExprFree(pRoot) below. */
187235 Fts3Expr *pLeft = pRoot->pLeft;
187236 Fts3Expr *pRight = pRoot->pRight;
187238 pRoot->pLeft = 0;
187239 pRoot->pRight = 0;
187253 pRoot->pLeft = pLeft;
187254 pLeft->pParent = pRoot;
187255 pRoot->pRight = pRight;
187256 pRight->pParent = pRoot;
187262 sqlite3Fts3ExprFree(pRoot);
187263 pRoot = 0;
187265 *pp = pRoot;
193990 NodeWriter *pRoot; /* NodeWriter for root node */
194035 pRoot = &pWriter->aNodeWriter[iRoot];
194056 pRoot->block.a, pRoot->block.n /* root */
194059 sqlite3_free(pRoot->block.a);
194060 sqlite3_free(pRoot->key.a);
199350 JsonNode *pRoot = &pParse->aNode[iRoot];
199351 if( zPath[0]==0 ) return pRoot;
199352 if( pRoot->jnFlags & JNODE_REPLACE ) return 0;
199354 if( pRoot->eType!=JSON_OBJECT ) return 0;
199378 while( j<=pRoot->n ){
199379 if( jsonLabelCompare(pRoot+j, zKey, nKey) ){
199383 j += jsonNodeSize(&pRoot[j]);
199385 if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
199386 assert( pRoot->eU==2 );
199387 iRoot += pRoot->u.iAppend;
199388 pRoot = &pParse->aNode[iRoot];
199400 pRoot = &pParse->aNode[iRoot];
199401 assert( pRoot->eU==0 );
199402 pRoot->u.iAppend = iStart - iRoot;
199403 pRoot->jnFlags |= JNODE_APPEND;
199404 VVA( pRoot->eU = 2 );
199418 JsonNode *pBase = pRoot;
199420 if( pRoot->eType!=JSON_ARRAY ) return 0;
199452 if( pRoot->eType!=JSON_ARRAY ) return 0;
199456 while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){
199457 if( (pRoot[j].jnFlags & JNODE_REMOVE)==0 ) i--;
199458 j += jsonNodeSize(&pRoot[j]);
199460 if( (pRoot->jnFlags & JNODE_APPEND)==0 ) break;
199461 assert( pRoot->eU==2 );
199462 iRoot += pRoot->u.iAppend;
199463 pRoot = &pParse->aNode[iRoot];
199466 if( j<=pRoot->n ){
199476 pRoot = &pParse->aNode[iRoot];
199477 assert( pRoot->eU==0 );
199478 pRoot->u.iAppend = iStart - iRoot;
199479 pRoot->jnFlags |= JNODE_APPEND;
199480 VVA( pRoot->eU = 2 );
202785 RtreeNode *pRoot = 0;
202827 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
202885 pCsr->aNode[0] = pRoot;
202886 pRoot = 0;
202892 nodeRelease(pRtree, pRoot);
204002 RtreeNode *pRoot = 0; /* Root node of rtree structure */
204006 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
204047 if( rc==SQLITE_OK && pRtree->iDepth>0 && NCELL(pRoot)==1 ){
204050 i64 iChild = nodeGetRowid(pRtree, pRoot, 0);
204051 rc = nodeAcquire(pRtree, iChild, pRoot, &pChild); /* tag-20210916a */
204059 writeInt16(pRoot->zData, pRtree->iDepth);
204060 pRoot->isDirty = 1;
204076 rc = nodeRelease(pRtree, pRoot);
204078 nodeRelease(pRtree, pRoot);
206699 RtreeNode *pRoot = 0;
206732 rc = nodeAcquire(pRtree, 1, 0, &pRoot);
206797 pCsr->aNode[0] = pRoot;
206798 pRoot = 0;
206805 nodeRelease(pRtree, pRoot);
226417 Fts5ExprNode *pRoot;
226641 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&sParse.rc, nByte);
226642 if( pNew->pRoot ){
226643 pNew->pRoot->bEof = 1;
226646 pNew->pRoot = sParse.pExpr;
226758 sqlite3Fts5ParseNodeFree(p->pRoot);
226772 p1->pRoot = sqlite3Fts5ParseNode(&sParse, FTS5_AND, p1->pRoot, p2->pRoot,0);
226773 p2->pRoot = 0;
227684 if( pAnd->bNomatch && pAnd!=pExpr->pRoot ){
227860 Fts5ExprNode *pRoot = p->pRoot;
227865 rc = fts5ExprNodeFirst(p, pRoot);
227870 && 0==pRoot->bEof
227871 && fts5RowidCmp(p, pRoot->iRowid, iFirst)<0
227873 rc = fts5ExprNodeNext(p, pRoot, 1, iFirst);
227877 while( pRoot->bNomatch && rc==SQLITE_OK ){
227878 assert( pRoot->bEof==0 );
227879 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
227892 Fts5ExprNode *pRoot = p->pRoot;
227893 assert( pRoot->bEof==0 && pRoot->bNomatch==0 );
227895 rc = fts5ExprNodeNext(p, pRoot, 0, 0);
227896 assert( pRoot->bNomatch==0 || (rc==SQLITE_OK && pRoot->bEof==0) );
227897 }while( pRoot->bNomatch );
227898 if( fts5RowidCmp(p, pRoot->iRowid, iLast)>0 ){
227899 pRoot->bEof = 1;
227905 return p->pRoot->bEof;
227909 return p->pRoot->iRowid;
228210 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc,
228214 pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
228227 pNew->pRoot->pNear->pColset = pColset;
228259 pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase;
228260 pNew->pRoot->pNear->nPhrase = 1;
228261 sCtx.pPhrase->pNode = pNew->pRoot;
228267 pNew->pRoot->eType = FTS5_TERM;
228268 pNew->pRoot->xNext = fts5ExprNodeNext_TERM;
228270 pNew->pRoot->eType = FTS5_STRING;
228271 pNew->pRoot->xNext = fts5ExprNodeNext_STRING;
229069 if( pExpr->pRoot->xNext==0 ){
229072 zText = fts5ExprPrintTcl(pConfig, zNearsetCmd, pExpr->pRoot);
229074 zText = fts5ExprPrint(pConfig, pExpr->pRoot);
229218 if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
229254 (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
229404 fts5ExprCheckPoslists(pExpr->pRoot, iRowid);
229424 && pNode->iRowid==pExpr->pRoot->iRowid