/ Check-in [62d38240]
Login

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

Overview
Comment:Fix to the logic that disables constraints on virtual tables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | nextgen-query-plan-exp
Files: files | file ages | folders
SHA1: 62d382406b28c1347e13114f42215939ddfd7a9d
User & Date: drh 2013-06-03 16:03:16
Context
2013-06-03
16:56
Honor the orderByConsumed boolean returned from virtual table query planner. check-in: aaf7f589 user: drh tags: nextgen-query-plan-exp
16:03
Fix to the logic that disables constraints on virtual tables. check-in: 62d38240 user: drh tags: nextgen-query-plan-exp
15:34
Fix an issue that was causing ORDER BY DESC to come out in ascending order. check-in: 02984012 user: drh tags: nextgen-query-plan-exp
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  4322   4322             sqlite3ErrorMsg(pParse, "%s.xBestIndex() malfunction", pTab->zName);
  4323   4323             goto whereLoopAddVtab_exit;
  4324   4324           }
  4325   4325           pTerm = &pWC->a[j];
  4326   4326           pNew->prereq |= pTerm->prereqRight;
  4327   4327           pNew->aTerm[iTerm] = pTerm;
  4328   4328           if( iTerm>mxTerm ) mxTerm = iTerm;
  4329         -        if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<<i;
         4329  +        if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<<iTerm;
  4330   4330           if( (pTerm->eOperator & WO_IN)!=0 ){
  4331   4331             if( pUsage[i].omit==0 ){
  4332   4332               /* Do not attempt to use an IN constraint if the virtual table
  4333   4333               ** says that the equivalent EQ constraint cannot be safely omitted.
  4334   4334               ** If we do attempt to use such a constraint, some rows might be
  4335   4335               ** repeated in the output. */
  4336   4336               break;