/ Check-in [f01030a0]
Login

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

Overview
Comment:Prevent a segfault when automatic indices try to use a column with an unknown collating function. Ticket [77aa3b1e6592582e38605d36]. This check-in also removes some stray \r characters unrelated to the problem.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f01030a0df4f94f886ab209ee8766b095da28c1e
User & Date: drh 2011-02-10 17:46:14
Context
2011-02-10
18:56
Split the documentation for sqlite3_wal_checkpoint_v2() and its constants onto separate pages. No changes to code. check-in: 0ef8ffd1 user: drh tags: trunk
17:46
Prevent a segfault when automatic indices try to use a column with an unknown collating function. Ticket [77aa3b1e6592582e38605d36]. This check-in also removes some stray \r characters unrelated to the problem. check-in: f01030a0 user: drh tags: trunk
00:08
Refactor the cost function in the query planner. Give extra cost (thus reduce likelihood of selection) to full table scans. check-in: 878da276 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

    88     88   /*
    89     89   ** Return the default collation sequence for the expression pExpr. If
    90     90   ** there is no default collation type, return 0.
    91     91   */
    92     92   CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
    93     93     CollSeq *pColl = 0;
    94     94     Expr *p = pExpr;
    95         -  while( ALWAYS(p) ){
           95  +  while( p ){
    96     96       int op;
    97     97       pColl = p->pColl;
    98     98       if( pColl ) break;
    99     99       op = p->op;
   100    100       if( p->pTab!=0 && (
   101    101           op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_REGISTER || op==TK_TRIGGER
   102    102       )){

Changes to src/where.c.

  1878   1878         int iCol = pTerm->u.leftColumn;
  1879   1879         Bitmask cMask = iCol>=BMS ? ((Bitmask)1)<<(BMS-1) : ((Bitmask)1)<<iCol;
  1880   1880         if( (idxCols & cMask)==0 ){
  1881   1881           Expr *pX = pTerm->pExpr;
  1882   1882           idxCols |= cMask;
  1883   1883           pIdx->aiColumn[n] = pTerm->u.leftColumn;
  1884   1884           pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight);
  1885         -        pIdx->azColl[n] = pColl->zName;
         1885  +        assert( pColl!=0 || pParse->nErr>0 );
         1886  +        pIdx->azColl[n] = pColl ? pColl->zName : "BINARY";
  1886   1887           n++;
  1887   1888         }
  1888   1889       }
  1889   1890     }
  1890   1891     assert( (u32)n==pLevel->plan.nEq );
  1891   1892   
  1892   1893     /* Add additional columns needed to make the automatic index into