/ Check-in [bbd69fa6]
Login
Overview
Comment:When doing a table scan using an index, do not error out if collating functions used by that index are unavailable, since they will not be used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:bbd69fa6fa7f3c86fb5cd1b69e1abbe1bbad61aa281e6c073a402d1b202e42ec
User & Date: drh 2017-12-07 22:10:16
Context
2017-12-08
14:07
Make sure the bComplex variable in sqlite3DeleteFrom() is initialized when compiling with -DSQLITE_OMIT_TRIGGER. check-in: e526d0c4 user: drh tags: trunk
2017-12-07
22:10
When doing a table scan using an index, do not error out if collating functions used by that index are unavailable, since they will not be used. check-in: bbd69fa6 user: drh tags: trunk
22:04
Fix typo in comment. No changes to code. check-in: 95958b60 user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/where.c.

4866
4867
4868
4869
4870
4871
4872







4873


4874
4875
4876
4877
4878
4879
4880
        iIndexCur = pParse->nTab++;
      }
      pLevel->iIdxCur = iIndexCur;
      assert( pIx->pSchema==pTab->pSchema );
      assert( iIndexCur>=0 );
      if( op ){
        sqlite3VdbeAddOp3(v, op, iIndexCur, pIx->tnum, iDb);







        sqlite3VdbeSetP4KeyInfo(pParse, pIx);


        if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0
         && (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0
         && (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0
         && pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED
        ){
          sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); /* Hint to COMDB2 */
        }







>
>
>
>
>
>
>

>
>







4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
        iIndexCur = pParse->nTab++;
      }
      pLevel->iIdxCur = iIndexCur;
      assert( pIx->pSchema==pTab->pSchema );
      assert( iIndexCur>=0 );
      if( op ){
        sqlite3VdbeAddOp3(v, op, iIndexCur, pIx->tnum, iDb);

        /* If the index is only being scanned - if there is no searching -
        ** then no collating functions are required.  Set db->init.busy in that
        ** case, to prevent sqlite3VdbeSetP4KeyInfo() from raising needless
        ** errors about the missing collating functions. */
        assert( db->init.busy==0 );
        db->init.busy = (pLoop->wsFlags & ~(WHERE_IDX_ONLY|WHERE_INDEXED))==0;
        sqlite3VdbeSetP4KeyInfo(pParse, pIx);
        db->init.busy = 0;  /* Restore db->init.busy */

        if( (pLoop->wsFlags & WHERE_CONSTRAINT)!=0
         && (pLoop->wsFlags & (WHERE_COLUMN_RANGE|WHERE_SKIPSCAN))==0
         && (pWInfo->wctrlFlags&WHERE_ORDERBY_MIN)==0
         && pWInfo->eDistinct!=WHERE_DISTINCT_ORDERED
        ){
          sqlite3VdbeChangeP5(v, OPFLAG_SEEKEQ); /* Hint to COMDB2 */
        }