/ Check-in [505a2f20]
Login

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

Overview
Comment:Add a NEVER() on an unreachable branch in comparisonAffinity().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | rowvalue
Files: files | file ages | folders
SHA1: 505a2f20eac62d4e170f003255c8984e4f3b0918
User & Date: drh 2016-08-24 15:37:31
Context
2016-08-24
17:49
Fix more unreachable branches. check-in: 6099c180 user: drh tags: rowvalue
15:37
Add a NEVER() on an unreachable branch in comparisonAffinity(). check-in: 505a2f20 user: drh tags: rowvalue
12:22
Fix a buffer overrun in the code for handling IN(...) operators when the LHS of the operator contains indexed columns or expressions. check-in: f41a0391 user: dan tags: rowvalue
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

   217    217             pExpr->op==TK_NE || pExpr->op==TK_IS || pExpr->op==TK_ISNOT );
   218    218     assert( pExpr->pLeft );
   219    219     aff = sqlite3ExprAffinity(pExpr->pLeft);
   220    220     if( pExpr->pRight ){
   221    221       aff = sqlite3CompareAffinity(pExpr->pRight, aff);
   222    222     }else if( ExprHasProperty(pExpr, EP_xIsSelect) ){
   223    223       aff = sqlite3CompareAffinity(pExpr->x.pSelect->pEList->a[0].pExpr, aff);
   224         -  }else if( !aff ){
          224  +  }else if( NEVER(aff==0) ){
   225    225       aff = SQLITE_AFF_BLOB;
   226    226     }
   227    227     return aff;
   228    228   }
   229    229   
   230    230   /*
   231    231   ** pExpr is a comparison expression, eg. '=', '<', IN(...) etc.