/ Check-in [418a4da2]
Login

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

Overview
Comment:In where.c::findIndexCol - make sure that the Expr.op is TK_COLUMN before accessing the Expr.iColumn and Expr.iTable fields. Also fix a couple of unreachable branches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 418a4da2a96cf33055f18c9a667754fad2111cf3
User & Date: drh 2011-07-09 13:00:41
Context
2011-07-09
16:17
Fix harmless compiler warnings on unix. check-in: 90b1aea1 user: drh tags: trunk
13:00
In where.c::findIndexCol - make sure that the Expr.op is TK_COLUMN before accessing the Expr.iColumn and Expr.iTable fields. Also fix a couple of unreachable branches. check-in: 418a4da2 user: drh tags: trunk
2011-07-08
17:02
Change the default chunk size on test_multiplex.c to 2147418112 bytes (formerly 1073741824 bytes) and make the default configurable at compile-time using SQLITE_MULTIPLEX_CHUNK_SIZE and at run-time using the "chunksize" URI query parameter. Add support fo test_multiplex to the shell. check-in: e305b5a9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/where.c.

  1416   1416     int iCol                        /* Column of index to match */
  1417   1417   ){
  1418   1418     int i;
  1419   1419     const char *zColl = pIdx->azColl[iCol];
  1420   1420   
  1421   1421     for(i=0; i<pList->nExpr; i++){
  1422   1422       Expr *p = pList->a[i].pExpr;
  1423         -    if( pIdx->aiColumn[iCol]==p->iColumn && iBase==p->iTable ){
         1423  +    if( p->op==TK_COLUMN
         1424  +     && p->iColumn==pIdx->aiColumn[iCol]
         1425  +     && p->iTable==iBase
         1426  +    ){
  1424   1427         CollSeq *pColl = sqlite3ExprCollSeq(pParse, p);
  1425         -      if( pColl && 0==sqlite3StrICmp(pColl->zName, zColl) ){
         1428  +      if( ALWAYS(pColl) && 0==sqlite3StrICmp(pColl->zName, zColl) ){
  1426   1429           return i;
  1427   1430         }
  1428   1431       }
  1429   1432     }
  1430   1433   
  1431   1434     return -1;
  1432   1435   }
................................................................................
  1676   1679         ** to sort because the primary key is unique and so none of the other
  1677   1680         ** columns will make any difference
  1678   1681         */
  1679   1682         j = nTerm;
  1680   1683       }
  1681   1684     }
  1682   1685   
  1683         -  if( pbRev ) *pbRev = sortOrder!=0;
         1686  +  *pbRev = sortOrder!=0;
  1684   1687     if( j>=nTerm ){
  1685   1688       /* All terms of the ORDER BY clause are covered by this index so
  1686   1689       ** this index can be used for sorting. */
  1687   1690       return 1;
  1688   1691     }
  1689   1692     if( pIdx->onError!=OE_None && i==pIdx->nColumn
  1690   1693         && (wsFlags & WHERE_COLUMN_NULL)==0