/ Check-in [915416d1]
Login

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

Overview
Comment:Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 915416d15f43c4e1d3afa8121bb6fa09f9f67e30
User & Date: drh 2016-05-18 21:01:27
Context
2016-05-18
21:03
Add the "scrub" utility program that simultaneously backs-up a live database and erases all deleted content. check-in: c981ab2a user: drh tags: trunk
21:01
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. check-in: 915416d1 user: drh tags: trunk
10:57
Version 3.13.0 check-in: fc49f556 user: drh tags: trunk, release, version-3.13.0
2016-05-09
19:58
Omit the unnecessary WHERE_REOPEN_IDX flag in the WHERE interface. Closed-Leaf check-in: da94a6e0 user: drh tags: dev
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

  2536   2536   #define WHERE_FORCE_TABLE      0x0020 /* Do not use an index-only search */
  2537   2537   #define WHERE_ONETABLE_ONLY    0x0040 /* Only code the 1st table in pTabList */
  2538   2538   #define WHERE_NO_AUTOINDEX     0x0080 /* Disallow automatic indexes */
  2539   2539   #define WHERE_GROUPBY          0x0100 /* pOrderBy is really a GROUP BY */
  2540   2540   #define WHERE_DISTINCTBY       0x0200 /* pOrderby is really a DISTINCT clause */
  2541   2541   #define WHERE_WANT_DISTINCT    0x0400 /* All output needs to be distinct */
  2542   2542   #define WHERE_SORTBYGROUP      0x0800 /* Support sqlite3WhereIsSorted() */
  2543         -#define WHERE_REOPEN_IDX       0x1000 /* Try to use OP_ReopenIdx */
         2543  +                           /*  0x1000    not currently used */
  2544   2544   #define WHERE_ONEPASS_MULTIROW 0x2000 /* ONEPASS is ok with multiple rows */
  2545   2545   #define WHERE_USE_LIMIT        0x4000 /* There is a constant LIMIT clause */
  2546   2546   #define WHERE_SEEK_TABLE       0x8000 /* Do not defer seeks on main table */
  2547   2547   
  2548   2548   /* Allowed return values from sqlite3WhereIsDistinct()
  2549   2549   */
  2550   2550   #define WHERE_DISTINCT_NOOP      0  /* DISTINCT keyword not used */

Changes to src/where.c.

  4475   4475             iIndexCur++;
  4476   4476             pJ = pJ->pNext;
  4477   4477           }
  4478   4478           op = OP_OpenWrite;
  4479   4479           pWInfo->aiCurOnePass[1] = iIndexCur;
  4480   4480         }else if( iAuxArg && (wctrlFlags & WHERE_ONETABLE_ONLY)!=0 ){
  4481   4481           iIndexCur = iAuxArg;
  4482         -        if( wctrlFlags & WHERE_REOPEN_IDX ) op = OP_ReopenIdx;
         4482  +        op = OP_ReopenIdx;
  4483   4483         }else{
  4484   4484           iIndexCur = pParse->nTab++;
  4485   4485         }
  4486   4486         pLevel->iIdxCur = iIndexCur;
  4487   4487         assert( pIx->pSchema==pTab->pSchema );
  4488   4488         assert( iIndexCur>=0 );
  4489   4489         if( op ){

Changes to src/wherecode.c.

  1625   1625             assert( (pSubLoop->wsFlags & WHERE_AUTO_INDEX)==0 );
  1626   1626             if( (pSubLoop->wsFlags & WHERE_INDEXED)!=0
  1627   1627              && (ii==0 || pSubLoop->u.btree.pIndex==pCov)
  1628   1628              && (HasRowid(pTab) || !IsPrimaryKeyIndex(pSubLoop->u.btree.pIndex))
  1629   1629             ){
  1630   1630               assert( pSubWInfo->a[0].iIdxCur==iCovCur );
  1631   1631               pCov = pSubLoop->u.btree.pIndex;
  1632         -            wctrlFlags |= WHERE_REOPEN_IDX;
  1633   1632             }else{
  1634   1633               pCov = 0;
  1635   1634             }
  1636   1635   
  1637   1636             /* Finish the loop through table entries that match term pOrTerm. */
  1638   1637             sqlite3WhereEnd(pSubWInfo);
  1639   1638           }