• Home
  • Raw
  • Download

Lines Matching refs:pSeg

151675     Fts3SegReader *pSeg = 0;
151676 rc = sqlite3Fts3SegReaderPending(p, iIndex, zTerm, nTerm, isPrefix||isScan, &pSeg);
151677 if( rc==SQLITE_OK && pSeg ){
151678 rc = fts3SegReaderCursorAppend(pCsr, pSeg);
151688 Fts3SegReader *pSeg = 0;
151709 iEndBlock, zRoot, nRoot, &pSeg
151712 rc = fts3SegReaderCursorAppend(pCsr, pSeg);
160182 static void fts3SegReaderSetEof(Fts3SegReader *pSeg){
160183 if( !fts3SegReaderIsRootOnly(pSeg) ){
160184 sqlite3_free(pSeg->aNode);
160185 sqlite3_blob_close(pSeg->pBlob);
160186 pSeg->pBlob = 0;
160188 pSeg->aNode = 0;
160734 Fts3SegReader *pSeg, /* Segment reader object */
160739 if( pSeg->aNode ){
160740 if( pSeg->nTerm>nTerm ){
160741 res = memcmp(pSeg->zTerm, zTerm, nTerm);
160743 res = memcmp(pSeg->zTerm, zTerm, pSeg->nTerm);
160746 res = pSeg->nTerm-nTerm;
161384 Fts3SegReader *pSeg /* Segment to delete */
161387 if( pSeg->iStartBlock ){
161391 sqlite3_bind_int64(pDelete, 1, pSeg->iStartBlock);
161392 sqlite3_bind_int64(pDelete, 2, pSeg->iEndBlock);
161552 Fts3SegReader *pSeg;
161553 pSeg = pMsr->apSegment[0];
161555 if( pSeg->pOffsetList==0 ){
161618 Fts3SegReader *pSeg = pCsr->apSegment[i];
161620 int rc = fts3SegReaderNext(p, pSeg, 0);
161622 }while( zTerm && (res = fts3SegReaderTermCmp(pSeg, zTerm, nTerm))<0 );
161624 if( pSeg->bLookup && res!=0 ){
161625 fts3SegReaderSetEof(pSeg);
161665 Fts3SegReader *pSeg = pCsr->apSegment[i];
161666 if( !pSeg->aNode || fts3SegReaderTermCmp(pSeg, zTerm, nTerm) ){
161747 Fts3SegReader *pSeg = apSegment[i];
161748 if( pSeg->bLookup ){
161749 fts3SegReaderSetEof(pSeg);
161751 rc = fts3SegReaderNext(p, pSeg, 0);
163561 Fts3SegReader *pSeg = 0;
163567 pSeg = pCsr->apSegment[j];
163568 if( pSeg->iIdx==i ) break;
163570 assert( j<pCsr->nSegment && pSeg->iIdx==i );
163572 if( pSeg->aNode==0 ){
163574 rc = fts3DeleteSegment(p, pSeg);
163576 rc = fts3RemoveSegdirEntry(p, iAbsLevel, pSeg->iIdx);
163583 const char *zTerm = pSeg->zTerm;
163584 int nTerm = pSeg->nTerm;
163585 rc = fts3TruncateSegment(p, iAbsLevel, pSeg->iIdx, zTerm, nTerm);
194700 Fts5StructureSegment *pSeg; /* Segment to iterate through */
195436 static int fts5SegmentSize(Fts5StructureSegment *pSeg){
195437 return 1 + pSeg->pgnoLast - pSeg->pgnoFirst;
195497 Fts5StructureSegment *pSeg; /* Segment just written */
195502 pSeg = &pStruct->aLevel[iLvl].aSeg[pStruct->aLevel[iLvl].nSeg-1];
195503 szSeg = (1 + pSeg->pgnoLast - pSeg->pgnoFirst);
195793 Fts5StructureSegment *pSeg = pIter->pSeg;
195799 }else if( pIter->iLeafPgno<=pSeg->pgnoLast ){
195801 FTS5_SEGMENT_ROWID(pSeg->iSegid, pIter->iLeafPgno)
195961 Fts5StructureSegment *pSeg, /* Description of segment */
195964 if( pSeg->pgnoFirst==0 ){
195977 pIter->pSeg = pSeg;
195978 pIter->iLeafPgno = pSeg->pgnoFirst-1;
196070 pIter->pSeg->iSegid, pIter->iLeafPgno
196113 Fts5SegIter *pSeg = &pIter->aSeg[pIter->aFirst[1].iFirst];
196114 return (p->rc==SQLITE_OK && pSeg->pLeaf && pSeg->nPos==0);
196171 if( pIter->pSeg && iOff>=pIter->pLeaf->szLeaf ){
196185 if( pIter->pSeg ){
196266 }else if( pIter->pSeg==0 ){
196370 int iSegid = pIter->pSeg->iSegid;
196393 Fts5StructureSegment *pSeg = pIter->pSeg;
196397 for(pgno=pIter->iLeafPgno+1; !p->rc && pgno<=pSeg->pgnoLast; pgno++){
196398 i64 iAbs = FTS5_SEGMENT_ROWID(pSeg->iSegid, pgno);
196451 int iSeg = pIter->pSeg->iSegid;
196630 Fts5StructureSegment *pSeg, /* Description of segment */
196641 pIter->pSeg = pSeg;
196647 sqlite3_bind_int(pIdxSelect, 1, pSeg->iSegid);
196656 if( iPg<pSeg->pgnoFirst ){
196657 iPg = pSeg->pgnoFirst;
196923 if( iLeafPgno>pIter->pSeg->pgnoLast ){
197030 Fts5SegIter *pSeg = &pIter->aSeg[iEq];
197032 pSeg->xNext(p, pSeg, 0);
197092 Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ];
197093 pIter->base.bEof = pSeg->pLeaf==0;
197094 pIter->iSwitchRowid = pSeg->iRowid;
197115 Fts5SegIter *pSeg = &pIter->aSeg[iFirst];
197117 if( bUseFrom && pSeg->pDlidx ){
197118 fts5SegIterNextFrom(p, pSeg, iFrom);
197120 pSeg->xNext(p, pSeg, &bNewTerm);
197123 if( pSeg->pLeaf==0 || bNewTerm
197124 || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
197128 pSeg = &pIter->aSeg[pIter->aFirst[1].iFirst];
197129 if( pSeg->pLeaf==0 ) return;
197133 assert( pSeg==&pIter->aSeg[pIter->aFirst[1].iFirst] && pSeg->pLeaf );
197134 if( pIter->bSkipEmpty==0 || pSeg->nPos ){
197135 pIter->xSetOutputs(pIter, pSeg);
197152 Fts5SegIter *pSeg = &pIter->aSeg[iFirst];
197156 pSeg->xNext(p, pSeg, &bNewTerm);
197157 if( pSeg->pLeaf==0 || bNewTerm
197158 || fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
197311 Fts5SegIter *pSeg, /* Poslist of this iterator */
197315 int nRem = pSeg->nPos; /* Number of bytes still to come */
197317 u8 *pChunk = &pSeg->pLeaf->p[pSeg->iLeafOffset];
197318 int nChunk = MIN(nRem, pSeg->pLeaf->szLeaf - pSeg->iLeafOffset);
197319 int pgno = pSeg->iLeafPgno;
197325 if( (pSeg->flags & FTS5_SEGITER_REVERSE)==0 ){
197337 pData = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->pSeg->iSegid, pgno));
197342 assert( pSeg->pNextLeaf==0 );
197343 pSeg->pNextLeaf = pData;
197358 Fts5SegIter *pSeg,
197362 if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){
197364 fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback);
197372 fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistFilterCallback);
197378 fts5ChunkIterate(p, pSeg, (void*)&sCtx, fts5PoslistOffsetsCallback);
197450 static void fts5IterSetOutputs_None(Fts5Iter *pIter, Fts5SegIter *pSeg){
197452 pIter->base.iRowid = pSeg->iRowid;
197453 pIter->base.nData = pSeg->nPos;
197460 static void fts5IterSetOutputs_Nocolset(Fts5Iter *pIter, Fts5SegIter *pSeg){
197461 pIter->base.iRowid = pSeg->iRowid;
197462 pIter->base.nData = pSeg->nPos;
197467 if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
197470 pIter->base.pData = &pSeg->pLeaf->p[pSeg->iLeafOffset];
197476 fts5SegiterPoslist(pIter->pIndex, pSeg, 0, &pIter->poslist);
197485 static void fts5IterSetOutputs_ZeroColset(Fts5Iter *pIter, Fts5SegIter *pSeg){
197486 UNUSED_PARAM(pSeg);
197495 static void fts5IterSetOutputs_Col(Fts5Iter *pIter, Fts5SegIter *pSeg){
197497 fts5SegiterPoslist(pIter->pIndex, pSeg, pIter->pColset, &pIter->poslist);
197498 pIter->base.iRowid = pSeg->iRowid;
197513 static void fts5IterSetOutputs_Col100(Fts5Iter *pIter, Fts5SegIter *pSeg){
197518 if( pSeg->iLeafOffset+pSeg->nPos>pSeg->pLeaf->szLeaf ){
197519 fts5IterSetOutputs_Col(pIter, pSeg);
197521 u8 *a = (u8*)&pSeg->pLeaf->p[pSeg->iLeafOffset];
197522 u8 *pEnd = (u8*)&a[pSeg->nPos];
197530 pIter->base.iRowid = pSeg->iRowid;
197553 static void fts5IterSetOutputs_Full(Fts5Iter *pIter, Fts5SegIter *pSeg){
197555 pIter->base.iRowid = pSeg->iRowid;
197560 if( pSeg->iLeafOffset+pSeg->nPos<=pSeg->pLeaf->szLeaf ){
197563 const u8 *a = &pSeg->pLeaf->p[pSeg->iLeafOffset];
197565 pIter->base.nData = fts5IndexExtractCol(&a, pSeg->nPos,pColset->aiCol[0]);
197570 fts5IndexExtractColset(pRc, pColset, a, pSeg->nPos, &pIter->poslist);
197579 fts5SegiterPoslist(pIter->pIndex, pSeg, pColset, &pIter->poslist);
197678 Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg];
197681 fts5SegIterInit(p, pSeg, pIter);
197683 fts5SegIterSeekInit(p, pTerm, nTerm, flags, pSeg, pIter);
197704 Fts5SegIter *pSeg = &pNew->aSeg[iEq];
197705 if( p->rc==SQLITE_OK ) pSeg->xNext(p, pSeg, 0);
197715 Fts5SegIter *pSeg = &pNew->aSeg[pNew->aFirst[1].iFirst];
197716 pNew->xSetOutputs(pNew, pSeg);
198381 Fts5SegIter *pSeg = &pIter->aSeg[i];
198382 if( pSeg->pSeg==0 ){
198384 }else if( pSeg->pLeaf==0 ){
198388 pSeg->pSeg->pgnoLast = 0;
198389 pSeg->pSeg->pgnoFirst = 0;
198391 int iOff = pSeg->iTermLeafOffset; /* Offset on new first leaf page */
198394 int iId = pSeg->pSeg->iSegid;
198397 iLeafRowid = FTS5_SEGMENT_ROWID(iId, pSeg->iTermLeafPgno);
198403 fts5BufferAppendVarint(&p->rc, &buf, pSeg->term.n);
198404 fts5BufferAppendBlob(&p->rc, &buf, pSeg->term.n, pSeg->term.p);
198413 if( pSeg->iLeafPgno==pSeg->iTermLeafPgno
198414 && pSeg->iEndofDoclist<pData->szLeaf
198416 int nDiff = pData->szLeaf - pSeg->iEndofDoclist;
198419 pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff]
198424 pSeg->pSeg->pgnoFirst = pSeg->iTermLeafPgno;
198458 Fts5StructureSegment *pSeg; /* Output segment */
198474 pSeg = &pLvlOut->aSeg[pLvlOut->nSeg-1];
198476 fts5WriteInit(p, &writer, pSeg->iSegid);
198477 writer.writer.pgno = pSeg->pgnoLast+1;
198496 pSeg = &pLvlOut->aSeg[pLvlOut->nSeg];
198498 pSeg->pgnoFirst = 1;
198499 pSeg->iSegid = iSegid;
198556 fts5WriteFinish(p, &writer, &pSeg->pgnoLast);
198574 if( pSeg->pgnoLast==0 ){
198579 assert( pSeg->pgnoLast>0 );
198745 Fts5StructureSegment *pSeg; /* New segment within pStruct */
198864 pSeg = &pStruct->aLevel[0].aSeg[ pStruct->aLevel[0].nSeg++ ];
198865 pSeg->iSegid = iSegid;
198866 pSeg->pgnoFirst = 1;
198867 pSeg->pgnoLast = pgnoLast;
199329 Fts5SegIter *pSeg = &p1->aSeg[ p1->aFirst[1].iFirst ];
199330 int nTerm = pSeg->term.n;
199331 const u8 *pTerm = pSeg->term.p;
199332 p1->xSetOutputs(p1, pSeg);
199653 Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst];
199654 if( pSeg->pLeaf ) pRet->xSetOutputs(pRet, pSeg);
199694 Fts5SegIter *pSeg = &pIter->aSeg[ pIter->aFirst[1].iFirst ];
199695 if( pSeg->pLeaf && pSeg->term.p[0]!=FTS5_MAIN_PREFIX ){
199696 fts5DataRelease(pSeg->pLeaf);
199697 pSeg->pLeaf = 0;
200009 Fts5StructureSegment *pSeg, /* Segment to check internal consistency */
200019 Fts5Data *pLeaf = fts5DataRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, i));
200080 Fts5StructureSegment *pSeg /* Segment to check internal consistency */
200085 int iIdxPrevLeaf = pSeg->pgnoFirst-1;
200086 int iDlidxPrevLeaf = pSeg->pgnoLast;
200088 if( pSeg->pgnoFirst==0 ) return;
200092 pConfig->zDb, pConfig->zName, pSeg->iSegid
200107 if( iIdxLeaf<pSeg->pgnoFirst ) continue;
200108 iRow = FTS5_SEGMENT_ROWID(pSeg->iSegid, iIdxLeaf);
200143 p, pSeg, iIdxPrevLeaf+1, iDlidxPrevLeaf+1, iIdxLeaf-1
200151 int iSegid = pSeg->iSegid;
200193 iDlidxPrevLeaf = pSeg->pgnoLast;
200205 if( p->rc==SQLITE_OK && iter.iLeaf!=pSeg->pgnoLast ){
200244 Fts5StructureSegment *pSeg = &pStruct->aLevel[iLvl].aSeg[iSeg];
200245 fts5IndexIntegrityCheckSegment(p, pSeg);
200363 Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg];
200365 pSeg->iSegid, pSeg->pgnoFirst, pSeg->pgnoLast