/ Check-in [80277d2f]
Login

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

Overview
Comment:In two places, change the magic number -1 to its proper symbol XN_ROWID.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 80277d2fc9b76fe41e345d00952da1528e69884f25911cf6e4f78b09ff778421
User & Date: drh 2017-09-28 00:01:36
Context
2017-09-28
01:09
Indexes on expressions with a COLLATE clause are able to satisfy an ORDER BY with the same COLLATE clause. check-in: 04130018 user: drh tags: trunk
00:01
In two places, change the magic number -1 to its proper symbol XN_ROWID. check-in: 80277d2f user: drh tags: trunk
2017-09-27
16:51
Disable tests for the LIKE optimization when ICU is enabled, since the LIKE optimization only works for the built-in LIKE operator and ICU overrides the built-in. check-in: f5ef2e1b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  3654   3654   
  3655   3655           /* Get the column number in the table (iColumn) and sort order
  3656   3656           ** (revIdx) for the j-th column of the index.
  3657   3657           */
  3658   3658           if( pIndex ){
  3659   3659             iColumn = pIndex->aiColumn[j];
  3660   3660             revIdx = pIndex->aSortOrder[j];
  3661         -          if( iColumn==pIndex->pTable->iPKey ) iColumn = -1;
         3661  +          if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
  3662   3662           }else{
  3663   3663             iColumn = XN_ROWID;
  3664   3664             revIdx = 0;
  3665   3665           }
  3666   3666   
  3667   3667           /* An unconstrained column that might be NULL means that this
  3668   3668           ** WhereLoop is not well-ordered
................................................................................
  3681   3681           isMatch = 0;
  3682   3682           for(i=0; bOnce && i<nOrderBy; i++){
  3683   3683             if( MASKBIT(i) & obSat ) continue;
  3684   3684             pOBExpr = sqlite3ExprSkipCollate(pOrderBy->a[i].pExpr);
  3685   3685             testcase( wctrlFlags & WHERE_GROUPBY );
  3686   3686             testcase( wctrlFlags & WHERE_DISTINCTBY );
  3687   3687             if( (wctrlFlags & (WHERE_GROUPBY|WHERE_DISTINCTBY))==0 ) bOnce = 0;
  3688         -          if( iColumn>=(-1) ){
         3688  +          if( iColumn>=XN_ROWID ){
  3689   3689               if( pOBExpr->op!=TK_COLUMN ) continue;
  3690   3690               if( pOBExpr->iTable!=iCur ) continue;
  3691   3691               if( pOBExpr->iColumn!=iColumn ) continue;
  3692   3692             }else{
  3693   3693               if( sqlite3ExprCompare(0,
  3694   3694                     pOBExpr,pIndex->aColExpr->a[j].pExpr,iCur) ){
  3695   3695                 continue;