/ Check-in [dcb78793]
Login

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

Overview
Comment:Avoid reporting a NOMEM error if a memory allocation fails while copying the error message from a prepared statement into the database connection.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dcb78793474e533c3e4f5c6389ba3c997f062eee
User & Date: drh 2011-10-29 01:33:24
References
2011-10-31
06:52
Update fts3fault.test to account for the sqlite3_errmsg() related changes in [8f88cc4e61] and [dcb7879347]. check-in: 3f2d49c6 user: dan tags: trunk
2011-10-29
19:25
Update fkey_malloc.test to account for the sqlite3_errmsg() related changes in [8f88cc4e61] and [dcb7879347]. check-in: 5b82ec6f user: dan tags: trunk
Context
2011-10-29
11:43
Avoid attempting to call savepoint related methods on deleted sqlite3_vtab objects. Fix for [48f299634a]. check-in: 3565fcf8 user: dan tags: trunk
01:33
Avoid reporting a NOMEM error if a memory allocation fails while copying the error message from a prepared statement into the database connection. check-in: dcb78793 user: drh tags: trunk
2011-10-27
15:19
If an error occurs within sqlite3_step() on a statement prepared using sqlite3_prepare_v2(), transfer both the error code and error message to the database handle before sqlite3_step() returns (so that they are available via sqlite3_errcode() and sqlite3_errmsg(). Prior to this commit, only the error code was transfered. The error message was not available until after either sqlite3_reset() or sqlite3_finalize() had been called on the statement handle. check-in: 8f88cc4e user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  2318   2318   ** This function does not clear the VDBE error code or message, just
  2319   2319   ** copies them to the database handle.
  2320   2320   */
  2321   2321   int sqlite3VdbeTransferError(Vdbe *p){
  2322   2322     sqlite3 *db = p->db;
  2323   2323     int rc = p->rc;
  2324   2324     if( p->zErrMsg ){
         2325  +    u8 mallocFailed = db->mallocFailed;
  2325   2326       sqlite3BeginBenignMalloc();
  2326   2327       sqlite3ValueSetStr(db->pErr, -1, p->zErrMsg, SQLITE_UTF8, SQLITE_TRANSIENT);
  2327   2328       sqlite3EndBenignMalloc();
         2329  +    db->mallocFailed = mallocFailed;
  2328   2330       db->errCode = rc;
  2329   2331     }else{
  2330   2332       sqlite3Error(db, rc, 0);
  2331   2333     }
  2332   2334     return rc;
  2333   2335   }
  2334   2336