• Home
  • Raw
  • Download

Lines Matching refs:pReader

92052   PmaReader *pReader;             /* Readr data from here after Rewind() */
92956 assert( pSorter->bUseThreads || pSorter->pReader==0 );
92958 if( pSorter->pReader ){
92959 vdbePmaReaderClear(pSorter->pReader);
92960 sqlite3DbFree(db, pSorter->pReader);
92961 pSorter->pReader = 0;
93618 PmaReader *pReader = &pMerger->aReadr[ pMerger->aTree[1] ];
93619 int nKey = pReader->nKey;
93624 if( pReader->pFd==0 ) break;
93629 vdbePmaWriteBlob(&writer, pReader->aKey, nKey);
93981 PmaReader *pReader = (PmaReader*)pCtx;
93983 vdbePmaReaderIncrMergeInit(pReader,INCRINIT_TASK)
93985 pReader->pIncr->pTask->bDone = 1;
94247 pSorter->pReader = pReadr;
94340 assert( pSorter->pReader==0 );
94363 assert( pSorter->bUsePMA || (pSorter->pReader==0 && pSorter->pMerger==0) );
94365 assert( pSorter->pReader==0 || pSorter->pMerger==0 );
94366 assert( pSorter->bUseThreads==0 || pSorter->pReader );
94370 rc = vdbePmaReaderNext(pSorter->pReader);
94371 if( rc==SQLITE_OK && pSorter->pReader->pFd==0 ) rc = SQLITE_DONE;
94401 PmaReader *pReader;
94404 pReader = pSorter->pReader;
94408 pReader = &pSorter->pMerger->aReadr[pSorter->pMerger->aTree[1]];
94410 *pnKey = pReader->nKey;
94411 pKey = pReader->aKey;
171782 static int fts3SegReaderIncrRead(Fts3SegReader *pReader){
171786 nRead = MIN(pReader->nNode - pReader->nPopulate, FTS3_NODE_CHUNKSIZE);
171788 pReader->pBlob,
171789 &pReader->aNode[pReader->nPopulate],
171791 pReader->nPopulate
171795 pReader->nPopulate += nRead;
171796 memset(&pReader->aNode[pReader->nPopulate], 0, FTS3_NODE_PADDING);
171797 if( pReader->nPopulate==pReader->nNode ){
171798 sqlite3_blob_close(pReader->pBlob);
171799 pReader->pBlob = 0;
171800 pReader->nPopulate = 0;
171806 static int fts3SegReaderRequire(Fts3SegReader *pReader, char *pFrom, int nByte){
171808 assert( !pReader->pBlob
171809 || (pFrom>=pReader->aNode && pFrom<&pReader->aNode[pReader->nNode])
171811 while( pReader->pBlob && rc==SQLITE_OK
171812 && (pFrom - pReader->aNode + nByte)>pReader->nPopulate
171814 rc = fts3SegReaderIncrRead(pReader);
171838 Fts3SegReader *pReader,
171846 if( !pReader->aDoclist ){
171847 pNext = pReader->aNode;
171849 pNext = &pReader->aDoclist[pReader->nDoclist];
171852 if( !pNext || pNext>=&pReader->aNode[pReader->nNode] ){
171854 if( fts3SegReaderIsPending(pReader) ){
171855 Fts3HashElem *pElem = *(pReader->ppNextElem);
171856 sqlite3_free(pReader->aNode);
171857 pReader->aNode = 0;
171862 pReader->zTerm = (char *)fts3HashKey(pElem);
171863 pReader->nTerm = fts3HashKeysize(pElem);
171867 pReader->nNode = pReader->nDoclist = nCopy;
171868 pReader->aNode = pReader->aDoclist = aCopy;
171869 pReader->ppNextElem++;
171870 assert( pReader->aNode );
171875 fts3SegReaderSetEof(pReader);
171880 assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock || CORRUPT_DB );
171882 if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){
171887 p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode,
171888 (bIncr ? &pReader->nPopulate : 0)
171891 assert( pReader->pBlob==0 );
171892 if( bIncr && pReader->nPopulate<pReader->nNode ){
171893 pReader->pBlob = p->pSegments;
171896 pNext = pReader->aNode;
171899 assert( !fts3SegReaderIsPending(pReader) );
171901 rc = fts3SegReaderRequire(pReader, pNext, FTS3_VARINT_MAX*2);
171909 || (&pReader->aNode[pReader->nNode] - pNext)<nSuffix
171910 || nPrefix>pReader->nTerm
171918 if( (i64)nPrefix+nSuffix>(i64)pReader->nTermAlloc ){
171920 char *zNew = sqlite3_realloc64(pReader->zTerm, nNew);
171924 pReader->zTerm = zNew;
171925 pReader->nTermAlloc = nNew;
171928 rc = fts3SegReaderRequire(pReader, pNext, nSuffix+FTS3_VARINT_MAX);
171931 memcpy(&pReader->zTerm[nPrefix], pNext, nSuffix);
171932 pReader->nTerm = nPrefix+nSuffix;
171934 pNext += fts3GetVarint32(pNext, &pReader->nDoclist);
171935 pReader->aDoclist = pNext;
171936 pReader->pOffsetList = 0;
171942 if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode)
171943 || (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1])
171954 static int fts3SegReaderFirstDocid(Fts3Table *pTab, Fts3SegReader *pReader){
171956 assert( pReader->aDoclist );
171957 assert( !pReader->pOffsetList );
171958 if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
171960 pReader->iDocid = 0;
171961 pReader->nOffsetList = 0;
171963 pReader->aDoclist, pReader->nDoclist, &pReader->pOffsetList,
171964 &pReader->iDocid, &pReader->nOffsetList, &bEof
171967 rc = fts3SegReaderRequire(pReader, pReader->aDoclist, FTS3_VARINT_MAX);
171969 int n = sqlite3Fts3GetVarint(pReader->aDoclist, &pReader->iDocid);
171970 pReader->pOffsetList = &pReader->aDoclist[n];
171988 Fts3SegReader *pReader, /* Reader to advance to next docid */
171993 char *p = pReader->pOffsetList;
171998 if( pTab->bDescIdx && fts3SegReaderIsPending(pReader) ){
172004 *ppOffsetList = pReader->pOffsetList;
172005 *pnOffsetList = pReader->nOffsetList - 1;
172008 pReader->aDoclist, pReader->nDoclist, &p, &pReader->iDocid,
172009 &pReader->nOffsetList, &bEof
172012 pReader->pOffsetList = 0;
172014 pReader->pOffsetList = p;
172017 char *pEnd = &pReader->aDoclist[pReader->nDoclist];
172033 if( pReader->pBlob==0 || p<&pReader->aNode[pReader->nPopulate] ) break;
172034 rc = fts3SegReaderIncrRead(pReader);
172043 *ppOffsetList = pReader->pOffsetList;
172044 *pnOffsetList = (int)(p - pReader->pOffsetList - 1);
172056 pReader->pOffsetList = 0;
172058 rc = fts3SegReaderRequire(pReader, p, FTS3_VARINT_MAX);
172061 pReader->pOffsetList = p + sqlite3Fts3GetVarintU(p, &iDelta);
172063 pReader->iDocid = (i64)((u64)pReader->iDocid - iDelta);
172065 pReader->iDocid = (i64)((u64)pReader->iDocid + iDelta);
172090 Fts3SegReader *pReader = pMsr->apSegment[ii];
172091 if( !fts3SegReaderIsPending(pReader)
172092 && !fts3SegReaderIsRootOnly(pReader)
172095 for(jj=pReader->iStartBlock; jj<=pReader->iLeafEndBlock; jj++){
172113 SQLITE_PRIVATE void sqlite3Fts3SegReaderFree(Fts3SegReader *pReader){
172114 if( pReader ){
172115 if( !fts3SegReaderIsPending(pReader) ){
172116 sqlite3_free(pReader->zTerm);
172118 if( !fts3SegReaderIsRootOnly(pReader) ){
172119 sqlite3_free(pReader->aNode);
172121 sqlite3_blob_close(pReader->pBlob);
172123 sqlite3_free(pReader);
172139 Fts3SegReader *pReader; /* Newly allocated SegReader object */
172152 pReader = (Fts3SegReader *)sqlite3_malloc(sizeof(Fts3SegReader) + nExtra);
172153 if( !pReader ){
172156 memset(pReader, 0, sizeof(Fts3SegReader));
172157 pReader->iIdx = iAge;
172158 pReader->bLookup = bLookup!=0;
172159 pReader->iStartBlock = iStartLeaf;
172160 pReader->iLeafEndBlock = iEndLeaf;
172161 pReader->iEndBlock = iEndBlock;
172165 pReader->aNode = (char *)&pReader[1];
172166 pReader->rootOnly = 1;
172167 pReader->nNode = nRoot;
172168 if( nRoot ) memcpy(pReader->aNode, zRoot, nRoot);
172169 memset(&pReader->aNode[nRoot], 0, FTS3_NODE_PADDING);
172171 pReader->iCurrentBlock = iStartLeaf-1;
172173 *ppReader = pReader;
172226 Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */
172285 pReader = (Fts3SegReader *)sqlite3_malloc64(nByte);
172286 if( !pReader ){
172289 memset(pReader, 0, nByte);
172290 pReader->iIdx = 0x7FFFFFFF;
172291 pReader->ppNextElem = (Fts3HashElem **)&pReader[1];
172292 memcpy(pReader->ppNextElem, aElem, nElem*sizeof(Fts3HashElem *));
172299 *ppReader = pReader;
209412 sqlite3_blob *pReader; /* RO incr-blob open on %_data table */
209735 if( p->pReader ){
209736 sqlite3_blob *pReader = p->pReader;
209737 p->pReader = 0;
209738 sqlite3_blob_close(pReader);
209753 if( p->pReader ){
209757 sqlite3_blob *pBlob = p->pReader;
209758 p->pReader = 0;
209760 assert( p->pReader==0 );
209761 p->pReader = pBlob;
209770 if( p->pReader==0 && rc==SQLITE_OK ){
209773 pConfig->zDb, p->zDataTbl, "block", iRowid, 0, &p->pReader
209786 int nByte = sqlite3_blob_bytes(p->pReader);
209797 rc = sqlite3_blob_read(p->pReader, aOut, nByte, 0);
214389 assert( p->pReader==0 );