/ Check-in [eb80ddc6]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:If an error (OOM or SQLITE_FULL error) occurs while executing an SQL statement and a statement-transaction is automatically rolled back as a result, if a second error occurs during the statement rollback do a full transaction rollback instead. Otherwise the client can be left with an inconsistent cache. This can affect both WAL and rollback modes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: eb80ddc665132c607c258b59131025a296269dad
User & Date: dan 2010-06-03 09:17:38
Original Comment: If an error (OOM or SQLITE_FULL error) occurs while executing an SQL statement and a statement-transaction is automatically rolled back as a result, if a second error occurs during the statement rollback do a full transaction rollback instead. Otherwise the client can be left with an inconsistent cache.
Context
2010-06-03
09:25
Enhancements to test_vfs.c and walfault.test. check-in: ac0de2f3 user: dan tags: trunk
09:17
If an error (OOM or SQLITE_FULL error) occurs while executing an SQL statement and a statement-transaction is automatically rolled back as a result, if a second error occurs during the statement rollback do a full transaction rollback instead. Otherwise the client can be left with an inconsistent cache. This can affect both WAL and rollback modes. check-in: eb80ddc6 user: dan tags: trunk
09:01
If a malloc fails while allocating a savepoint object at the pager level, do not try to roll that savepoint back later on. check-in: 91cb08ff user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  2139   2139       ** Note that sqlite3VdbeCloseStatement() can only fail if eStatementOp
  2140   2140       ** is SAVEPOINT_ROLLBACK.  But if p->rc==SQLITE_OK then eStatementOp
  2141   2141       ** must be SAVEPOINT_RELEASE.  Hence the NEVER(p->rc==SQLITE_OK) in 
  2142   2142       ** the following code.
  2143   2143       */
  2144   2144       if( eStatementOp ){
  2145   2145         rc = sqlite3VdbeCloseStatement(p, eStatementOp);
  2146         -      if( rc && (NEVER(p->rc==SQLITE_OK) || p->rc==SQLITE_CONSTRAINT) ){
  2147         -        p->rc = rc;
  2148         -        sqlite3DbFree(db, p->zErrMsg);
  2149         -        p->zErrMsg = 0;
         2146  +      if( rc ){
         2147  +        assert( eStatementOp==SAVEPOINT_ROLLBACK );
         2148  +        if( NEVER(p->rc==SQLITE_OK) || p->rc==SQLITE_CONSTRAINT ){
         2149  +          p->rc = rc;
         2150  +          sqlite3DbFree(db, p->zErrMsg);
         2151  +          p->zErrMsg = 0;
         2152  +        }
         2153  +        invalidateCursorsOnModifiedBtrees(db);
         2154  +        sqlite3RollbackAll(db);
         2155  +        sqlite3CloseSavepoints(db);
         2156  +        db->autoCommit = 1;
  2150   2157         }
  2151   2158       }
  2152   2159     
  2153   2160       /* If this was an INSERT, UPDATE or DELETE and no statement transaction
  2154   2161       ** has been rolled back, update the database connection change-counter. 
  2155   2162       */
  2156   2163       if( p->changeCntOn ){