/ Check-in [359d78e1]
Login

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

Overview
Comment:Fix a segfault following OOM that was introduced by check-in (6949) which was a fix for ticket #3997. (CVS 6954)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 359d78e144c2399791d341eda1760eb486f9740a
User & Date: drh 2009-08-01 15:09:58
Context
2009-08-01
15:54
Add a testcase for ticket #3810. (CVS 6955) check-in: 29972f74 user: drh tags: trunk
15:09
Fix a segfault following OOM that was introduced by check-in (6949) which was a fix for ticket #3997. (CVS 6954) check-in: 359d78e1 user: drh tags: trunk
15:04
Increment the version number in preparation for the next release. (CVS 6953) check-in: 12d9b873 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle SELECT statements in SQLite.
    14     14   **
    15         -** $Id: select.c,v 1.525 2009/07/28 13:30:31 danielk1977 Exp $
           15  +** $Id: select.c,v 1.526 2009/08/01 15:09:58 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   
    20     20   /*
    21     21   ** Delete all the content of a Select structure but do not deallocate
    22     22   ** the select structure itself.
................................................................................
  2351   2351       if( pExpr->iColumn<0 ){
  2352   2352         pExpr->op = TK_NULL;
  2353   2353       }else{
  2354   2354         Expr *pNew;
  2355   2355         assert( pEList!=0 && pExpr->iColumn<pEList->nExpr );
  2356   2356         assert( pExpr->pLeft==0 && pExpr->pRight==0 );
  2357   2357         pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0);
  2358         -      if( pExpr->pColl ){
  2359         -	pNew->pColl = pExpr->pColl;
         2358  +      if( pNew && pExpr->pColl ){
         2359  +        pNew->pColl = pExpr->pColl;
  2360   2360         }
  2361   2361         sqlite3ExprDelete(db, pExpr);
  2362   2362         pExpr = pNew;
  2363   2363       }
  2364   2364     }else{
  2365   2365       pExpr->pLeft = substExpr(db, pExpr->pLeft, iTable, pEList);
  2366   2366       pExpr->pRight = substExpr(db, pExpr->pRight, iTable, pEList);