diff options
author | danielk1977 <danielk1977@noemail.net> | 2007-06-13 16:49:48 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2007-06-13 16:49:48 +0000 |
commit | 3fe11f3021ba0b17da63b81c6055da20b4596e21 (patch) | |
tree | c6f963b95bcb99da98faa5afa4c8d65f0b00ce55 /src | |
parent | e965ac77737585dce3b58e1e318856020920bf5e (diff) | |
download | sqlite-3fe11f3021ba0b17da63b81c6055da20b4596e21.tar.gz sqlite-3fe11f3021ba0b17da63b81c6055da20b4596e21.zip |
Have queries interrupted by the progress-handler return SQLITE_INTERRUPT. Rollback any active transaction if a DML statement returns SQLITE_INTERRUPT. (CVS 4061)
FossilOrigin-Name: 33454b5691637da7ded7d18d7f5726b796260c6b
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 9 | ||||
-rw-r--r-- | src/vdbeaux.c | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 4a93a16f1..9a575db64 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.624 2007/06/07 19:08:34 drh Exp $ +** $Id: vdbe.c,v 1.625 2007/06/13 16:49:49 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -547,12 +547,11 @@ int sqlite3VdbeExec( if( db->nProgressOps==nProgressOps ){ if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; if( db->xProgress(db->pProgressArg)!=0 ){ - sqlite3SafetyOn(db); - rc = SQLITE_ABORT; - continue; /* skip to the next iteration of the for loop */ + sqlite3_interrupt(db); } - nProgressOps = 0; if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; + CHECK_FOR_INTERRUPT; + nProgressOps = 0; } nProgressOps++; } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 47bb7a081..7457045f5 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1358,7 +1358,8 @@ int sqlite3VdbeHalt(Vdbe *p){ int mrc; /* Primary error code from p->rc */ /* Check for one of the special errors - SQLITE_NOMEM or SQLITE_IOERR */ mrc = p->rc & 0xff; - isSpecialError = ((mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR)?1:0); + isSpecialError = ( + (mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT)?1:0); if( isSpecialError ){ /* This loop does static analysis of the query to see which of the ** following three categories it falls into: |