/ Check-in [ff9fc722]
Login

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

Overview
Comment:Add a testcase macro to ensure testing a boundary case in DISTINCT processing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ff9fc722dc481df1ce6a9733db1f033b88141d5d
User & Date: drh 2011-07-02 19:12:05
Context
2011-07-04
06:52
Adjust a couple of test scripts so that they work with OMIT_UTF16 builds. check-in: 6c51bad0 user: dan tags: trunk
2011-07-02
19:12
Add a testcase macro to ensure testing a boundary case in DISTINCT processing. check-in: ff9fc722 user: drh tags: trunk
15:32
Ensure that automatic indexes are only created in scenarios where they may be used more than once. check-in: 27c65d4d user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  1451   1451     ExprList *pDistinct,            /* The DISTINCT expressions */
  1452   1452     int nEqCol                      /* Number of index columns with == */
  1453   1453   ){
  1454   1454     Bitmask mask = 0;               /* Mask of unaccounted for pDistinct exprs */
  1455   1455     int i;                          /* Iterator variable */
  1456   1456   
  1457   1457     if( pIdx->zName==0 || pDistinct==0 || pDistinct->nExpr>=BMS ) return 0;
         1458  +  testcase( pDistinct->nExpr==BMS-1 );
  1458   1459   
  1459   1460     /* Loop through all the expressions in the distinct list. If any of them
  1460   1461     ** are not simple column references, return early. Otherwise, test if the
  1461   1462     ** WHERE clause contains a "col=X" clause. If it does, the expression
  1462   1463     ** can be ignored. If it does not, and the column does not belong to the
  1463   1464     ** same table as index pIdx, return early. Finally, if there is no
  1464   1465     ** matching "col=X" expression and the column is on the same table as pIdx,