/ Check-in [06de3f2c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove unused parameters from internal fts3 function.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | fts3-prefix-search
Files: files | file ages | folders
SHA1: 06de3f2cbc27cdfd9f83218c9ea576f74f60d07b
User & Date: dan 2011-06-14 07:14:43
Context
2011-06-14
07:22
Merge recent trunk changes into fts3-prefix-search branch. check-in: 135ce30f user: dan tags: fts3-prefix-search
07:14
Remove unused parameters from internal fts3 function. check-in: 06de3f2c user: dan tags: fts3-prefix-search
2011-06-13
18:21
Update trace2.test to account for new FTS queries. check-in: 2c201292 user: dan tags: fts3-prefix-search
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3.c.

  3338   3338         sqlite3_free(aPoslist);
  3339   3339       }
  3340   3340     }
  3341   3341   
  3342   3342     return SQLITE_OK;
  3343   3343   }
  3344   3344   
  3345         -
  3346         -/*
  3347         -** The following three functions:
  3348         -**
  3349         -**     fts3EvalPhraseStart()
  3350         -**     fts3EvalPhraseNext()
  3351         -**
  3352         -** May be used with a phrase object after fts3EvalAllocateReaders() has been
  3353         -** called to iterate through the set of docids that match the phrase.
  3354         -**
  3355         -** After a successful call to fts3EvalPhraseNext(), the following two 
  3356         -** functions may be called to access the current docid and position-list.
  3357         -*/
  3358         -
  3359         -
  3360   3345   /*
  3361   3346   ** This function is called for each Fts3Phrase in a full-text query 
  3362   3347   ** expression to initialize the mechanism for returning rows. Once this
  3363   3348   ** function has been called successfully on an Fts3Phrase, it may be
  3364   3349   ** used with fts3EvalPhraseNext() to iterate through the matching docids.
  3365   3350   */
  3366   3351   static int fts3EvalPhraseStart(Fts3Cursor *pCsr, int bOptOk, Fts3Phrase *p){
................................................................................
  4154   4139       pExpr->bStart = 0;
  4155   4140   
  4156   4141       fts3EvalRestart(pCsr, pExpr->pLeft, pRc);
  4157   4142       fts3EvalRestart(pCsr, pExpr->pRight, pRc);
  4158   4143     }
  4159   4144   }
  4160   4145   
  4161         -static void fts3EvalUpdateCounts(
  4162         -  Fts3Cursor *pCsr,
  4163         -  Fts3Expr *pExpr,
  4164         -  int *pRc
  4165         -){
  4166         -  if( pExpr && *pRc==SQLITE_OK ){
         4146  +/*
         4147  +** After allocating the Fts3Expr.aMI[] array for each phrase in the 
         4148  +** expression rooted at pExpr, the cursor iterates through all rows matched
         4149  +** by pExpr, calling this function for each row. This function increments
         4150  +** the values in Fts3Expr.aMI[] according to the position-list currently
         4151  +** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase 
         4152  +** expression nodes.
         4153  +*/
         4154  +static void fts3EvalUpdateCounts(Fts3Expr *pExpr){
         4155  +  if( pExpr ){
  4167   4156       Fts3Phrase *pPhrase = pExpr->pPhrase;
  4168   4157       if( pPhrase && pPhrase->doclist.pList ){
  4169   4158         int iCol = 0;
  4170   4159         char *p = pPhrase->doclist.pList;
  4171   4160   
  4172   4161         assert( *p );
  4173   4162         while( 1 ){
................................................................................
  4185   4174           pExpr->aMI[iCol*3 + 2] += (iCnt>0);
  4186   4175           if( *p==0x00 ) break;
  4187   4176           p++;
  4188   4177           p += sqlite3Fts3GetVarint32(p, &iCol);
  4189   4178         }
  4190   4179       }
  4191   4180   
  4192         -    fts3EvalUpdateCounts(pCsr, pExpr->pLeft, pRc);
  4193         -    fts3EvalUpdateCounts(pCsr, pExpr->pRight, pRc);
         4181  +    fts3EvalUpdateCounts(pExpr->pLeft);
         4182  +    fts3EvalUpdateCounts(pExpr->pRight);
  4194   4183     }
  4195   4184   }
  4196   4185   
         4186  +/*
         4187  +** Expression pExpr must be of type FTSQUERY_PHRASE.
         4188  +**
         4189  +** If it is not already allocated and populated, this function allocates and
         4190  +** populates the Fts3Expr.aMI[] array for expression pExpr. If pExpr is part
         4191  +** of a NEAR expression, then it also allocates and populates the same array
         4192  +** for all other phrases that are part of the NEAR expression.
         4193  +**
         4194  +** SQLITE_OK is returned if the aMI[] array is successfully allocated and
         4195  +** populated. Otherwise, if an error occurs, an SQLite error code is returned.
         4196  +*/
  4197   4197   static int fts3EvalGatherStats(
  4198         -  Fts3Cursor *pCsr,
  4199         -  Fts3Expr *pExpr
         4198  +  Fts3Cursor *pCsr,               /* Cursor object */
         4199  +  Fts3Expr *pExpr                 /* FTSQUERY_PHRASE expression */
  4200   4200   ){
  4201   4201     int rc = SQLITE_OK;             /* Return code */
  4202   4202   
  4203   4203     assert( pExpr->eType==FTSQUERY_PHRASE );
  4204   4204     if( pExpr->aMI==0 ){
  4205   4205       Fts3Table *pTab = (Fts3Table *)pCsr->base.pVtab;
  4206   4206       Fts3Expr *pRoot;                /* Root of NEAR expression */
................................................................................
  4244   4244           pCsr->isMatchinfoNeeded = 1;
  4245   4245           pCsr->iPrevId = pRoot->iDocid;
  4246   4246         }while( pCsr->isEof==0 
  4247   4247              && pRoot->eType==FTSQUERY_NEAR 
  4248   4248              && fts3EvalLoadDeferred(pCsr, &rc) 
  4249   4249         );
  4250   4250   
  4251         -      if( pCsr->isEof==0 ){
  4252         -        fts3EvalUpdateCounts(pCsr, pRoot, &rc);
         4251  +      if( rc==SQLITE_OK && pCsr->isEof==0 ){
         4252  +        fts3EvalUpdateCounts(pRoot);
  4253   4253         }
  4254   4254       }
  4255   4255   
  4256   4256       pCsr->isEof = 0;
  4257   4257       pCsr->iPrevId = iPrevId;
  4258   4258   
  4259   4259       if( bEof ){