/ Check-in [6480916c]
Login

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

Overview
Comment:Simplify error handling logic in sqlite3_exec() to save about 40 bytes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6480916c7266437cf8a70e5db2ca5c753ad71c361b68e41cbf8572f77c271920
User & Date: drh 2017-06-28 01:21:16
Context
2017-06-28
11:56
In the lemon-generated parser, automatically promote SHIFTREDUCE actions on nonterminal systems to pure REDUCE actions, for a performance enhancement. check-in: c46d94a8 user: drh tags: trunk
01:21
Simplify error handling logic in sqlite3_exec() to save about 40 bytes. check-in: 6480916c user: drh tags: trunk
01:12
Minor code simplification in the ALTER TABLE logic. check-in: bfc4e7f3 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/legacy.c.

   123    123   
   124    124   exec_out:
   125    125     if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
   126    126     sqlite3DbFree(db, azCols);
   127    127   
   128    128     rc = sqlite3ApiExit(db, rc);
   129    129     if( rc!=SQLITE_OK && pzErrMsg ){
   130         -    int nErrMsg = 1 + sqlite3Strlen30(sqlite3_errmsg(db));
   131         -    *pzErrMsg = sqlite3Malloc(nErrMsg);
   132         -    if( *pzErrMsg ){
   133         -      memcpy(*pzErrMsg, sqlite3_errmsg(db), nErrMsg);
   134         -    }else{
          130  +    *pzErrMsg = sqlite3DbStrDup(0, sqlite3_errmsg(db));
          131  +    if( *pzErrMsg==0 ){
   135    132         rc = SQLITE_NOMEM_BKPT;
   136    133         sqlite3Error(db, SQLITE_NOMEM);
   137    134       }
   138    135     }else if( pzErrMsg ){
   139    136       *pzErrMsg = 0;
   140    137     }
   141    138   
   142    139     assert( (rc&db->errMask)==rc );
   143    140     sqlite3_mutex_leave(db->mutex);
   144    141     return rc;
   145    142   }