Home | History | Annotate | Download | only in dist

Lines Matching refs:pNode

44774   unixShmNode *pNode = pShm->pShmNode;
44776 sqlite3_str_appendf(pStr, "{\"h\":%d", pNode->hShm);
44778 sqlite3_str_appendf(pStr, ",\"nRef\":%d", pNode->nRef);
44782 if( unixPosixAdvisoryLocks(pNode->hShm, aLck)==SQLITE_OK ){
207874 NodeWriter *pNode = &pWriter->aNodeWriter[iLayer];
207884 nPrefix = fts3PrefixCompress(pNode->key.a, pNode->key.n, zTerm, nTerm);
207890 if( pNode->key.n==0 || (pNode->block.n + nSpace)<=p->nNodeSize ){
207895 Blob *pBlk = &pNode->block;
207904 blobGrowBuffer(&pNode->key, nTerm, &rc);
207907 if( pNode->key.n ){
207916 memcpy(pNode->key.a, zTerm, nTerm);
207917 pNode->key.n = nTerm;
207923 rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n);
207925 assert( pNode->block.nAlloc>=p->nNodeSize );
207926 pNode->block.a[0] = (char)iLayer;
207927 pNode->block.n = 1 + sqlite3Fts3PutVarint(&pNode->block.a[1], iPtr+1);
207929 iNextPtr = pNode->iBlock;
207930 pNode->iBlock++;
207931 pNode->key.n = 0;
207944 ** stored in blob *pNode. The node need not contain any terms, but the
207959 ** It is assumed that the buffer associated with pNode is already large
207967 Blob *pNode, /* Current node image to append to */
207981 assert( pNode->n>0 );
207982 assert_fts3_nc( (pNode->a[0]=='\0')==(aDoclist!=0) );
207996 pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nPrefix);
207998 pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nSuffix);
207999 memcpy(&pNode->a[pNode->n], &zTerm[nPrefix], nSuffix);
208000 pNode->n += nSuffix;
208003 pNode->n += sqlite3Fts3PutVarint(&pNode->a[pNode->n], nDoclist);
208004 memcpy(&pNode->a[pNode->n], aDoclist, nDoclist);
208005 pNode->n += nDoclist;
208008 assert( pNode->n<=pNode->nAlloc );
208124 NodeWriter *pNode = &pWriter->aNodeWriter[iRoot];
208125 if( pNode->block.n>0 ) break;
208126 assert( *pRc || pNode->block.nAlloc==0 );
208127 assert( *pRc || pNode->key.nAlloc==0 );
208128 sqlite3_free(pNode->block.a);
208129 sqlite3_free(pNode->key.a);
208165 NodeWriter *pNode = &pWriter->aNodeWriter[i];
208166 if( pNode->block.n>0 && rc==SQLITE_OK ){
208167 rc = fts3WriteSegment(p, pNode->iBlock, pNode->block.a, pNode->block.n);
208169 sqlite3_free(pNode->block.a);
208170 sqlite3_free(pNode->key.a);
208332 NodeWriter *pNode;
208348 pNode = &pWriter->aNodeWriter[nHeight];
208349 pNode->iBlock = pWriter->iStart + pWriter->nLeafEst*nHeight;
208350 blobGrowBuffer(&pNode->block,
208354 memcpy(pNode->block.a, aRoot, nRoot);
208355 pNode->block.n = nRoot;
208356 memset(&pNode->block.a[nRoot], 0, FTS3_NODE_PADDING);
208362 pNode = &pWriter->aNodeWriter[i];
208364 if( pNode->block.a){
208365 rc = nodeReaderInit(&reader, pNode->block.a, pNode->block.n);
208367 blobGrowBuffer(&pNode->key, reader.term.n, &rc);
208371 memcpy(pNode->key.a, reader.term.a, reader.term.n);
208373 pNode->key.n = reader.term.n;
208377 pNode = &pWriter->aNodeWriter[i-1];
208378 pNode->iBlock = reader.iChild;
208380 blobGrowBuffer(&pNode->block,
208384 memcpy(pNode->block.a, aBlock, nBlock);
208385 pNode->block.n = nBlock;
208386 memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
208602 static void fts3StartNode(Blob *pNode, int iHeight, sqlite3_int64 iChild){
208603 pNode->a[0] = (char)iHeight;
208605 assert( pNode->nAlloc>=1+sqlite3Fts3VarintLen(iChild) );
208606 pNode->n = 1 + sqlite3Fts3PutVarint(&pNode->a[1], iChild);
208608 assert( pNode->nAlloc>=1 );
208609 pNode->n = 1;
218473 #define NCELL(pNode) readInt16(&(pNode)->zData[2])
218752 ** Add node pNode to the node hash table.
218754 static void nodeHashInsert(Rtree *pRtree, RtreeNode *pNode){
218756 assert( pNode->pNext==0 );
218757 iHash = nodeHash(pNode->iNode);
218758 pNode->pNext = pRtree->aHash[iHash];
218759 pRtree->aHash[iHash] = pNode;
218763 ** Remove node pNode from the node hash table.
218765 static void nodeHashDelete(Rtree *pRtree, RtreeNode *pNode){
218767 if( pNode->iNode!=0 ){
218768 pp = &pRtree->aHash[nodeHash(pNode->iNode)];
218769 for( ; (*pp)!=pNode; pp = &(*pp)->pNext){ assert(*pp); }
218770 *pp = pNode->pNext;
218771 pNode->pNext = 0;
218782 RtreeNode *pNode;
218783 pNode = (RtreeNode *)sqlite3_malloc64(sizeof(RtreeNode) + pRtree->iNodeSize);
218784 if( pNode ){
218785 memset(pNode, 0, sizeof(RtreeNode) + pRtree->iNodeSize);
218786 pNode->zData = (u8 *)&pNode[1];
218787 pNode->nRef = 1;
218789 pNode->pParent = pParent;
218790 pNode->isDirty = 1;
218793 return pNode;
218815 RtreeNode *pNode = 0;
218820 if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
218821 if( pParent && ALWAYS(pParent!=pNode->pParent) ){
218825 pNode->nRef++;
218826 *ppNode = pNode;
218854 pNode = (RtreeNode *)sqlite3_malloc64(sizeof(RtreeNode)+pRtree->iNodeSize);
218855 if( !pNode ){
218858 pNode->pParent = pParent;
218859 pNode->zData = (u8 *)&pNode[1];
218860 pNode->nRef = 1;
218862 pNode->iNode = iNode;
218863 pNode->isDirty = 0;
218864 pNode->pNext = 0;
218865 rc = sqlite3_blob_read(pRtree->pNodeBlob, pNode->zData,
218876 if( rc==SQLITE_OK && pNode && iNode==1 ){
218877 pRtree->iDepth = readInt16(pNode->zData);
218888 if( pNode && rc==SQLITE_OK ){
218889 if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){
218896 if( pNode!=0 ){
218898 nodeHashInsert(pRtree, pNode);
218903 *ppNode = pNode;
218906 if( pNode ){
218908 sqlite3_free(pNode);
218917 ** Overwrite cell iCell of node pNode with the contents of pCell.
218921 RtreeNode *pNode, /* The node into which the cell is to be written */
218923 int iCell /* Index into pNode into which pCell is written */
218926 u8 *p = &pNode->zData[4 + pRtree->nBytesPerCell*iCell];
218931 pNode->isDirty = 1;
218935 ** Remove the cell with index iCell from node pNode.
218937 static void nodeDeleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell){
218938 u8 *pDst = &pNode->zData[4 + pRtree->nBytesPerCell*iCell];
218940 int nByte = (NCELL(pNode) - iCell - 1) * pRtree->nBytesPerCell;
218942 writeInt16(&pNode->zData[2], NCELL(pNode)-1);
218943 pNode->isDirty = 1;
218947 ** Insert the contents of cell pCell into node pNode. If the insert
218950 ** If there is not enough free space in pNode, return SQLITE_FULL.
218954 RtreeNode *pNode, /* Write new cell into this node */
218957 int nCell; /* Current number of cells in pNode */
218958 int nMaxCell; /* Maximum number of cells for pNode */
218961 nCell = NCELL(pNode);
218965 nodeOverwriteCell(pRtree, pNode, pCell, nCell);
218966 writeInt16(&pNode->zData[2], nCell+1);
218967 pNode->isDirty = 1;
218976 static int nodeWrite(Rtree *pRtree, RtreeNode *pNode){
218978 if( pNode->isDirty ){
218980 if( pNode->iNode ){
218981 sqlite3_bind_int64(p, 1, pNode->iNode);
218985 sqlite3_bind_blob(p, 2, pNode->zData, pRtree->iNodeSize, SQLITE_STATIC);
218987 pNode->isDirty = 0;
218990 if( pNode->iNode==0 && rc==SQLITE_OK ){
218991 pNode->iNode = sqlite3_last_insert_rowid(pRtree->db);
218992 nodeHashInsert(pRtree, pNode);
219002 static int nodeRelease(Rtree *pRtree, RtreeNode *pNode){
219004 if( pNode ){
219005 assert( pNode->nRef>0 );
219007 pNode->nRef--;
219008 if( pNode->nRef==0 ){
219010 if( pNode->iNode==1 ){
219013 if( pNode->pParent ){
219014 rc = nodeRelease(pRtree, pNode->pParent);
219017 rc = nodeWrite(pRtree, pNode);
219019 nodeHashDelete(pRtree, pNode);
219020 sqlite3_free(pNode);
219028 ** node pNode. If pNode is a leaf node, this is a rowid. If it is
219033 RtreeNode *pNode, /* The node from which to extract the ID */
219036 assert( iCell<NCELL(pNode) );
219037 return readInt64(&pNode->zData[4 + pRtree->nBytesPerCell*iCell]);
219041 ** Return coordinate iCoord from cell iCell in node pNode.
219045 RtreeNode *pNode, /* The node from which to extract a coordinate */
219050 assert( iCell<NCELL(pNode) );
219051 readCoord(&pNode->zData[12 + pRtree->nBytesPerCell*iCell + 4*iCoord], pCoord);
219055 ** Deserialize cell iCell of node pNode. Populate the structure pointed
219060 RtreeNode *pNode, /* The node containing the cell to be read */
219067 pCell->iRowid = nodeGetRowid(pRtree, pNode, iCell);
219068 pData = pNode->zData + (12 + pRtree->nBytesPerCell*iCell);
219483 ** One of the cells in node pNode is guaranteed to have a 64-bit
219488 RtreeNode *pNode,
219493 int nCell = NCELL(pNode);
219496 if( nodeGetRowid(pRtree, pNode, ii)==iRowid ){
219506 ** Return the index of the cell containing a pointer to node pNode
219507 ** in its parent. If pNode is the root node, return -1.
219509 static int nodeParentIndex(Rtree *pRtree, RtreeNode *pNode, int *piIndex){
219510 RtreeNode *pParent = pNode->pParent;
219512 return nodeRowidIndex(pRtree, pParent, pNode->iNode, piIndex);
219741 RtreeNode *pNode;
219753 pNode = rtreeNodeOfFirstSearchPoint(pCur, &rc);
219755 nCell = NCELL(pNode);
219757 pCellData = pNode->zData + (4+pRtree->nBytesPerCell*p->iCell);
219841 RtreeNode *pNode = rtreeNodeOfFirstSearchPoint(pCsr, &rc);
219843 if( p->iCell>=NCELL(pNode) ){
219846 *pRowid = nodeGetRowid(RTREE_OF_CURSOR(pCsr), pNode, p->iCell);
219861 RtreeNode *pNode = rtreeNodeOfFirstSearchPoint(pCsr, &rc);
219865 if( p->iCell>=NCELL(pNode) ) return SQLITE_ABORT;
219867 sqlite3_result_int64(ctx, nodeGetRowid(pRtree, pNode, p->iCell));
219869 nodeGetCoord(pRtree, pNode, p->iCell, i-1, &c);
219887 nodeGetRowid(pRtree, pNode, p->iCell));
220351 RtreeNode *pNode = 0;
220352 rc = nodeAcquire(pRtree, 1, 0, &pNode);
220360 int nCell = NCELL(pNode);
220363 /* First check to see if there is are any cells in pNode that completely
220364 ** contains pCell. If two or more cells in pNode completely contain pCell
220369 nodeGetCell(pRtree, pNode, iCell, &cell);
220380 /* No cells of pNode will completely contain pCell. So pick the
220381 ** cell of pNode that grows by the least amount when pCell is added.
220388 nodeGetCell(pRtree, pNode, iCell, &cell);
220403 rc = nodeAcquire(pRtree, iBest, pNode, &pChild);
220404 nodeRelease(pRtree, pNode);
220405 pNode = pChild;
220408 *ppLeaf = pNode;
220414 ** the node pNode. This function updates the bounding box cells in
220419 RtreeNode *pNode, /* Adjust ancestry of this node. */
220422 RtreeNode *p = pNode;
220647 RtreeNode *pNode,
220655 for(p=pNode; p; p=p->pParent){
220660 nodeReference(pNode);
220661 pChild->pParent = pNode;
220664 if( NEVER(pNode==0) ) return SQLITE_ERROR;
220665 return xSetMapping(pRtree, iRowid, pNode->iNode);
220670 RtreeNode *pNode,
220678 int nCell = NCELL(pNode);
220699 nodeGetCell(pRtree, pNode, i, &aCell[i]);
220701 nodeZero(pRtree, pNode);
220705 if( pNode->iNode==1 ){
220706 pRight = nodeNew(pRtree, pNode);
220707 pLeft = nodeNew(pRtree, pNode);
220709 pNode->isDirty = 1;
220710 writeInt16(pNode->zData, pRtree->iDepth);
220712 pLeft = pNode;
220745 if( pNode->iNode==1 ){
220777 if( pNode->iNode==1 ){
220842 static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){
220848 assert( pNode->nRef==1 );
220851 rc = nodeParentIndex(pRtree, pNode, &iCell);
220853 pParent = pNode->pParent;
220854 pNode->pParent = 0;
220867 sqlite3_bind_int64(pRtree->pDeleteNode, 1, pNode->iNode);
220874 sqlite3_bind_int64(pRtree->pDeleteParent, 1, pNode->iNode);
220883 nodeHashDelete(pRtree, pNode);
220884 pNode->iNode = iHeight;
220885 pNode->pNext = pRtree->pDeleted;
220886 pNode->nRef++;
220887 pRtree->pDeleted = pNode;
220892 static int fixBoundingBox(Rtree *pRtree, RtreeNode *pNode){
220893 RtreeNode *pParent = pNode->pParent;
220897 int nCell = NCELL(pNode);
220898 RtreeCell box; /* Bounding box for pNode */
220899 nodeGetCell(pRtree, pNode, 0, &box);
220902 nodeGetCell(pRtree, pNode, ii, &cell);
220905 box.iRowid = pNode->iNode;
220906 rc = nodeParentIndex(pRtree, pNode, &ii);
220916 ** Delete the cell at index iCell of node pNode. After removing the
220919 static int deleteCell(Rtree *pRtree, RtreeNode *pNode, int iCell, int iHeight){
220923 if( SQLITE_OK!=(rc = fixLeafParent(pRtree, pNode)) ){
220930 nodeDeleteCell(pRtree, pNode, iCell);
220937 pParent = pNode->pParent;
220938 assert( pParent || pNode->iNode==1 );
220940 if( NCELL(pNode)<RTREE_MINCELLS(pRtree) ){
220941 rc = removeNode(pRtree, pNode, iHeight);
220943 rc = fixBoundingBox(pRtree, pNode);
220951 ** Insert cell pCell into node pNode. Node pNode is the head of a
220956 RtreeNode *pNode,
220965 nodeReference(pNode);
220966 pChild->pParent = pNode;
220969 if( nodeInsertCell(pRtree, pNode, pCell) ){
220970 rc = SplitNode(pRtree, pNode, pCell, iHeight);
220972 rc = AdjustTree(pRtree, pNode, pCell);
220975 rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode);
220977 rc = parentWrite(pRtree, pCell->iRowid, pNode->iNode);
220984 static int reinsertNodeContent(Rtree *pRtree, RtreeNode *pNode){
220987 int nCell = NCELL(pNode);
220992 nodeGetCell(pRtree, pNode, ii, &cell);
220994 /* Find a node to store this cell in. pNode->iNode currently contains
220997 rc = ChooseLeaf(pRtree, &cell, (int)pNode->iNode, &pInsert);
221000 rc = rtreeInsertCell(pRtree, pInsert, &cell, (int)pNode->iNode);
222034 const u8 *pNode = (const u8*)sqlite3_column_blob(pCheck->pGetNode, 0);
222039 memcpy(pRet, pNode, nNode);
223951 RtreeNode *pNode = rtreeNodeOfFirstSearchPoint(pCsr, &rc);
223964 nodeGetRowid(pRtree, pNode, p->iCell));
246323 Fts5ExprNode *pNode; /* FTS5_STRING node this phrase is part of */
246806 Fts5ExprNode *pNode, /* Node pPhrase belongs to */
246836 rc = fts5ExprSynonymList(pTerm, pNode->iRowid, &buf, &a, &n);
247101 Fts5ExprNode *pNode /* The "NEAR" node (FTS5_STRING) */
247103 Fts5ExprNearset *pNear = pNode->pNear;
247113 if( pIter->iRowid==pNode->iRowid && pIter->nData>0 ){
247131 rc = fts5ExprPhraseIsMatch(pNode, pPhrase, &bMatch);
247159 Fts5ExprNode *pNode
247161 Fts5ExprNearset *pNear = pNode->pNear;
247164 assert( pNode->bNomatch==0 );
247168 pNode->bEof = 1;
247198 pNode->bEof = 1;
247205 pNode->bEof = 0;
247234 static void fts5ExprSetEof(Fts5ExprNode *pNode){
247236 pNode->bEof = 1;
247237 pNode->bNomatch = 0;
247238 for(i=0; i<pNode->nChild; i++){
247239 fts5ExprSetEof(pNode->apChild[i]);
247243 static void fts5ExprNodeZeroPoslist(Fts5ExprNode *pNode){
247244 if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
247245 Fts5ExprNearset *pNear = pNode->pNear;
247253 for(i=0; i<pNode->nChild; i++){
247254 fts5ExprNodeZeroPoslist(pNode->apChild[i]);
247296 Fts5ExprNode *pNode
247298 Fts5ExprNearset *pNear = pNode->pNear;
247334 pNode->bNomatch = 0;
247335 pNode->bEof = 1;
247342 if( fts5ExprAdvanceto(pIter, bDesc, &iLast, &rc, &pNode->bEof) ){
247350 pNode->iRowid = iLast;
247351 pNode->bNomatch = ((0==fts5ExprNearTest(&rc, pExpr, pNode)) && rc==SQLITE_OK);
247352 assert( pNode->bEof==0 || pNode->bNomatch==0 );
247366 Fts5ExprNode *pNode, /* FTS5_STRING or FTS5_TERM node */
247370 Fts5ExprTerm *pTerm = &pNode->pNear->apPhrase[0]->aTerm[0];
247373 pNode->bNomatch = 0;
247406 pNode->bEof = (rc || bEof);
247410 assert( Fts5NodeIsString(pNode) );
247417 pNode->bEof = (rc || sqlite3Fts5IterEof(pIter));
247420 if( pNode->bEof==0 ){
247422 rc = fts5ExprNodeTest_STRING(pExpr, pNode);
247431 Fts5ExprNode *pNode /* The "NEAR" node (FTS5_TERM) */
247438 Fts5ExprPhrase *pPhrase = pNode->pNear->apPhrase[0];
247441 assert( pNode->eType==FTS5_TERM );
247442 assert( pNode->pNear->nPhrase==1 && pPhrase->nTerm==1 );
247449 pNode->iRowid = pIter->iRowid;
247450 pNode->bNomatch = (pPhrase->poslist.n==0);
247459 Fts5ExprNode *pNode,
247464 Fts5IndexIter *pIter = pNode->pNear->apPhrase[0]->aTerm[0].pIter;
247466 assert( pNode->bEof==0 );
247473 rc = fts5ExprNodeTest_TERM(pExpr, pNode);
247475 pNode->bEof = 1;
247476 pNode->bNomatch = 0;
247482 Fts5Expr *pExpr, /* Expression of which pNode is a part */
247483 Fts5ExprNode *pNode /* Expression node to test */
247485 Fts5ExprNode *pNext = pNode->apChild[0];
247488 for(i=1; i<pNode->nChild; i++){
247489 Fts5ExprNode *pChild = pNode->apChild[i];
247495 pNode->iRowid = pNext->iRowid;
247496 pNode->bEof = pNext->bEof;
247497 pNode->bNomatch = pNext->bNomatch;
247502 Fts5ExprNode *pNode,
247507 i64 iLast = pNode->iRowid;
247509 for(i=0; i<pNode->nChild; i++){
247510 Fts5ExprNode *p1 = pNode->apChild[i];
247518 pNode->bNomatch = 0;
247525 fts5ExprNodeTest_OR(pExpr, pNode);
247530 ** Argument pNode is an FTS5_AND node.
247586 Fts5ExprNode *pNode,
247590 int rc = fts5ExprNodeNext(pExpr, pNode->apChild[0], bFromValid, iFrom);
247592 rc = fts5ExprNodeTest_AND(pExpr, pNode);
247594 pNode->bNomatch = 0;
247601 Fts5ExprNode *pNode /* FTS5_NOT node to advance */
247604 Fts5ExprNode *p1 = pNode->apChild[0];
247605 Fts5ExprNode *p2 = pNode->apChild[1];
247606 assert( pNode->nChild==2 );
247618 pNode->bEof = p1->bEof;
247619 pNode->bNomatch = p1->bNomatch;
247620 pNode->iRowid = p1->iRowid;
247629 Fts5ExprNode *pNode,
247633 int rc = fts5ExprNodeNext(pExpr, pNode->apChild[0], bFromValid, iFrom);
247635 rc = fts5ExprNodeTest_NOT(pExpr, pNode);
247638 pNode->bNomatch = 0;
247644 ** If pNode currently points to a match, this function returns SQLITE_OK
247645 ** without modifying it. Otherwise, pNode is advanced until it does point
247649 Fts5Expr *pExpr, /* Expression of which pNode is a part */
247650 Fts5ExprNode *pNode /* Expression node to test */
247653 if( pNode->bEof==0 ){
247654 switch( pNode->eType ){
247657 rc = fts5ExprNodeTest_STRING(pExpr, pNode);
247662 rc = fts5ExprNodeTest_TERM(pExpr, pNode);
247667 rc = fts5ExprNodeTest_AND(pExpr, pNode);
247672 fts5ExprNodeTest_OR(pExpr, pNode);
247676 default: assert( pNode->eType==FTS5_NOT ); {
247677 rc = fts5ExprNodeTest_NOT(pExpr, pNode);
247687 ** Set node pNode, which is part of expression pExpr, to point to the first
247693 static int fts5ExprNodeFirst(Fts5Expr *pExpr, Fts5ExprNode *pNode){
247695 pNode->bEof = 0;
247696 pNode->bNomatch = 0;
247698 if( Fts5NodeIsString(pNode) ){
247700 rc = fts5ExprNearInitAll(pExpr, pNode);
247701 }else if( pNode->xNext==0 ){
247702 pNode->bEof = 1;
247706 for(i=0; i<pNode->nChild && rc==SQLITE_OK; i++){
247707 Fts5ExprNode *pChild = pNode->apChild[i];
247708 rc = fts5ExprNodeFirst(pExpr, pNode->apChild[i]);
247712 pNode->iRowid = pNode->apChild[0]->iRowid;
247714 switch( pNode->eType ){
247716 if( nEof>0 ) fts5ExprSetEof(pNode);
247720 if( pNode->nChild==nEof ) fts5ExprSetEof(pNode);
247724 assert( pNode->eType==FTS5_NOT );
247725 pNode->bEof = pNode->apChild[0]->bEof;
247731 rc = fts5ExprNodeTest(pExpr, pNode);
248130 Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset;
248174 sCtx.pPhrase->pNode = pNew->pRoot;
248388 ** Recursively apply colset pColset to expression node pNode and all of
248395 Fts5ExprNode *pNode,
248400 assert( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING
248401 || pNode->eType==FTS5_AND || pNode->eType==FTS5_OR
248402 || pNode->eType==FTS5_NOT || pNode->eType==FTS5_EOF
248404 if( pNode->eType==FTS5_STRING || pNode->eType==FTS5_TERM ){
248405 Fts5ExprNearset *pNear = pNode->pNear;
248409 pNode->eType = FTS5_EOF;
248410 pNode->xNext = 0;
248420 assert( pNode->eType!=FTS5_EOF || pNode->nChild==0 );
248421 for(i=0; i<pNode->nChild; i++){
248422 fts5ParseSetColset(pParse, pNode->apChild[i], pColset, ppFree);
248447 static void fts5ExprAssignXNext(Fts5ExprNode *pNode){
248448 switch( pNode->eType ){
248450 Fts5ExprNearset *pNear = pNode->pNear;
248455 pNode->eType = FTS5_TERM;
248456 pNode->xNext = fts5ExprNodeNext_TERM;
248458 pNode->xNext = fts5ExprNodeNext_STRING;
248464 pNode->xNext = fts5ExprNodeNext_OR;
248469 pNode->xNext = fts5ExprNodeNext_AND;
248473 default: assert( pNode->eType==FTS5_NOT ); {
248474 pNode->xNext = fts5ExprNodeNext_NOT;
248610 pNear->apPhrase[iPhrase]->pNode = pRet;
249161 Fts5ExprNode *pNode = pPhrase->pNode;
249162 if( pNode->bEof==0 && pNode->iRowid==pExpr->pRoot->iRowid ){
249195 Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode;
249198 (pBuf->n==0 || pNode->iRowid!=pExpr->pRoot->iRowid || pNode->bEof)
249298 Fts5ExprNode *pNode = pExpr->apExprPhrase[i]->pNode;
249299 Fts5Colset *pColset = pNode->pNear->pColset;
249314 static void fts5ExprClearPoslists(Fts5ExprNode *pNode){
249315 if( pNode->eType==FTS5_TERM || pNode->eType==FTS5_STRING ){
249316 pNode->pNear->apPhrase[0]->poslist.n = 0;
249319 for(i=0; i<pNode->nChild; i++){
249320 fts5ExprClearPoslists(pNode->apChild[i]);
249325 static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){
249326 pNode->iRowid = iRowid;
249327 pNode->bEof = 0;
249328 switch( pNode->eType ){
249332 return (pNode->pNear->apPhrase[0]->poslist.n>0);
249336 for(i=0; i<pNode->nChild; i++){
249337 if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid)==0 ){
249338 fts5ExprClearPoslists(pNode);
249348 for(i=0; i<pNode->nChild; i++){
249349 if( fts5ExprCheckPoslists(pNode->apChild[i], iRowid) ){
249357 assert( pNode->eType==FTS5_NOT );
249358 if( 0==fts5ExprCheckPoslists(pNode->apChild[0], iRowid)
249359 || 0!=fts5ExprCheckPoslists(pNode->apChild[1], iRowid)
249361 fts5ExprClearPoslists(pNode);
249384 Fts5ExprNode *pNode = pPhrase->pNode;
249390 if( pNode->bEof==0
249391 && pNode->iRowid==pExpr->pRoot->iRowid
249398 pTerm, pNode->iRowid, pBuf, (u8**)ppCollist, pnCollist