/ Check-in [2caaaab5]
Login

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

Overview
Comment:Put an ALWAYS() on an unreachable branch in the sqlite3ExprListDup() routine.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rowvalue-update-trigger
Files: files | file ages | folders
SHA1:2caaaab5e07f6b76d66fbe4e93a4b956937427d8
User & Date: drh 2017-01-02 23:18:35
Context
2017-01-02
23:43
Test cases for the row-value UPDATE TRIGGER fix. check-in: b9b96437 user: drh tags: rowvalue-update-trigger
23:18
Put an ALWAYS() on an unreachable branch in the sqlite3ExprListDup() routine. check-in: 2caaaab5 user: drh tags: rowvalue-update-trigger
22:36
Proposed fix for the row-value TRIGGER UPDATE problem described in ticket [8c9458e7]. check-in: 61a442ea user: drh tags: rowvalue-update-trigger
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/expr.c.

1307
1308
1309
1310
1311
1312
1313

1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
    return 0;
  } 
  pOldItem = p->a;
  for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
    Expr *pOldExpr = pOldItem->pExpr;
    Expr *pNewExpr;
    pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);

    if( pOldExpr 
     && pOldExpr->op==TK_SELECT_COLUMN
     && (pNewExpr = pItem->pExpr)!=0 
    ){
      assert( pNewExpr->iColumn==0 || i>0 );
      if( pNewExpr->iColumn==0 ){
        assert( pOldExpr->pLeft==pOldExpr->pRight );
        pNewExpr->pLeft = pNewExpr->pRight;
      }else if( pItem[-1].pExpr!=0 ){
        pNewExpr->pLeft = pItem[-1].pExpr->pLeft;
      }
    }
    pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
    pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan);
    pItem->sortOrder = pOldItem->sortOrder;
    pItem->done = 0;







>








|







1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
    return 0;
  } 
  pOldItem = p->a;
  for(i=0; i<p->nExpr; i++, pItem++, pOldItem++){
    Expr *pOldExpr = pOldItem->pExpr;
    Expr *pNewExpr;
    pItem->pExpr = sqlite3ExprDup(db, pOldExpr, flags);
    assert( pItem->pExpr==0 || db->mallocFailed==0 );
    if( pOldExpr 
     && pOldExpr->op==TK_SELECT_COLUMN
     && (pNewExpr = pItem->pExpr)!=0 
    ){
      assert( pNewExpr->iColumn==0 || i>0 );
      if( pNewExpr->iColumn==0 ){
        assert( pOldExpr->pLeft==pOldExpr->pRight );
        pNewExpr->pLeft = pNewExpr->pRight;
      }else if( ALWAYS(pItem[-1].pExpr!=0) ){
        pNewExpr->pLeft = pItem[-1].pExpr->pLeft;
      }
    }
    pItem->zName = sqlite3DbStrDup(db, pOldItem->zName);
    pItem->zSpan = sqlite3DbStrDup(db, pOldItem->zSpan);
    pItem->sortOrder = pOldItem->sortOrder;
    pItem->done = 0;