/ Check-in [1061e94f]
Login

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

Overview
Comment:Fix the sqlite3ValueFromExpr() routine so that it returns SQLITE_NOMEM on an OOM when trying to extract a NULL.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1061e94fa983a441b289753b873559163ab849e6
User & Date: drh 2011-02-18 17:23:23
Context
2011-02-19
15:22
Changes to make WAL more robust against SQLITE_PROTOCOL errors. check-in: fd578a32 user: drh tags: trunk
2011-02-18
17:23
Fix the sqlite3ValueFromExpr() routine so that it returns SQLITE_NOMEM on an OOM when trying to extract a NULL. check-in: 1061e94f user: drh tags: trunk
2011-02-17
15:58
Remove a no-op code path from sqlite3ExprIsInteger(). Replace it with an assert() that proves it always does nothing. check-in: 7af66d1b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

  1080   1080         pVal->u.i = -1 * pVal->u.i;
  1081   1081         /* (double)-1 In case of SQLITE_OMIT_FLOATING_POINT... */
  1082   1082         pVal->r = (double)-1 * pVal->r;
  1083   1083         sqlite3ValueApplyAffinity(pVal, affinity, enc);
  1084   1084       }
  1085   1085     }else if( op==TK_NULL ){
  1086   1086       pVal = sqlite3ValueNew(db);
         1087  +    if( pVal==0 ) goto no_mem;
  1087   1088     }
  1088   1089   #ifndef SQLITE_OMIT_BLOB_LITERAL
  1089   1090     else if( op==TK_BLOB ){
  1090   1091       int nVal;
  1091   1092       assert( pExpr->u.zToken[0]=='x' || pExpr->u.zToken[0]=='X' );
  1092   1093       assert( pExpr->u.zToken[1]=='\'' );
  1093   1094       pVal = sqlite3ValueNew(db);