diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 7 | ||||
-rw-r--r-- | src/vdbeaux.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index a4177ae2e..3f7dd4447 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -3649,7 +3649,10 @@ case OP_Savepoint: { } } if( rc ) goto abort_due_to_error; - + if( p->eVdbeState==VDBE_HALT_STATE ){ + rc = SQLITE_DONE; + goto vdbe_return; + } break; } @@ -8602,7 +8605,7 @@ abort_due_to_error: testcase( sqlite3GlobalConfig.xLog!=0 ); sqlite3_log(rc, "statement aborts at %d: [%s] %s", (int)(pOp - aOp), p->zSql, p->zErrMsg); - sqlite3VdbeHalt(p); + if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){ db->flags |= SQLITE_CorruptRdOnly; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index a1908edf3..6e6e240cd 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -3044,9 +3044,7 @@ int sqlite3VdbeHalt(Vdbe *p){ ** one, or the complete transaction if there is no statement transaction. */ - if( p->eVdbeState!=VDBE_RUN_STATE ){ - return SQLITE_OK; - } + assert( p->eVdbeState==VDBE_RUN_STATE ); if( db->mallocFailed ){ p->rc = SQLITE_NOMEM_BKPT; } @@ -3306,7 +3304,7 @@ int sqlite3VdbeReset(Vdbe *p){ ** error, then it might not have been halted properly. So halt ** it now. */ - sqlite3VdbeHalt(p); + if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); /* If the VDBE has been run even partially, then transfer the error code ** and error message from the VDBE into the main database structure. But |