diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/sqliteInt.h | 7 | ||||
-rw-r--r-- | src/tokenize.c | 6 | ||||
-rw-r--r-- | src/util.c | 6 | ||||
-rw-r--r-- | src/vdbe.c | 12 | ||||
-rw-r--r-- | src/vdbeaux.c | 4 |
6 files changed, 22 insertions, 19 deletions
diff --git a/src/main.c b/src/main.c index 72d1a7abb..0a8ab426a 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.352 2006/07/11 14:17:52 drh Exp $ +** $Id: main.c,v 1.353 2006/07/26 01:39:30 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -382,8 +382,8 @@ int sqlite3_busy_timeout(sqlite3 *db, int ms){ ** Cause any pending operation to stop at its earliest opportunity. */ void sqlite3_interrupt(sqlite3 *db){ - if( !sqlite3SafetyCheck(db) ){ - db->flags |= SQLITE_Interrupt; + if( db && (db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_BUSY) ){ + db->u1.isInterrupted = 1; } } diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 145fab2d0..d5e4376c9 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.521 2006/07/11 14:17:52 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.522 2006/07/26 01:39:30 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -481,6 +481,10 @@ struct sqlite3 { sqlite3_value *pErr; /* Most recent error message */ char *zErrMsg; /* Most recent error message (UTF-8 encoded) */ char *zErrMsg16; /* Most recent error message (UTF-16 encoded) */ + union { + int isInterrupted; /* True if sqlite3_interrupt has been called */ + double notUsed1; /* Spacer */ + } u1; #ifndef SQLITE_OMIT_AUTHORIZATION int (*xAuth)(void*,int,const char*,const char*,const char*,const char*); /* Access authorization function */ @@ -520,7 +524,6 @@ struct sqlite3 { ** transaction is active on that particular database file. */ #define SQLITE_VdbeTrace 0x00000001 /* True to trace VDBE execution */ -#define SQLITE_Interrupt 0x00000004 /* Cancel current operation */ #define SQLITE_InTrans 0x00000008 /* True if in a transaction */ #define SQLITE_InternChanges 0x00000010 /* Uncommitted Hash table changes */ #define SQLITE_FullColNames 0x00000020 /* Show full column names on SELECT */ diff --git a/src/tokenize.c b/src/tokenize.c index ea584b1cd..04da0dcd3 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.121 2006/06/24 08:51:05 danielk1977 Exp $ +** $Id: tokenize.c,v 1.122 2006/07/26 01:39:30 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -394,7 +394,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ extern void sqlite3ParserFree(void*, void(*)(void*)); extern int sqlite3Parser(void*, int, Token, Parse*); - db->flags &= ~SQLITE_Interrupt; + db->u1.isInterrupted = 0; pParse->rc = SQLITE_OK; i = 0; pEngine = sqlite3ParserAlloc((void*(*)(int))sqlite3MallocX); @@ -418,7 +418,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ switch( tokenType ){ case TK_SPACE: case TK_COMMENT: { - if( (db->flags & SQLITE_Interrupt)!=0 ){ + if( db->u1.isInterrupted ){ pParse->rc = SQLITE_INTERRUPT; sqlite3SetString(pzErrMsg, "interrupt", (char*)0); goto abort_parse; diff --git a/src/util.c b/src/util.c index 79885b04d..905477d1f 100644 --- a/src/util.c +++ b/src/util.c @@ -14,7 +14,7 @@ ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.191 2006/07/11 12:40:25 drh Exp $ +** $Id: util.c,v 1.192 2006/07/26 01:39:30 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -1151,7 +1151,7 @@ int sqlite3SafetyOn(sqlite3 *db){ return 0; }else if( db->magic==SQLITE_MAGIC_BUSY ){ db->magic = SQLITE_MAGIC_ERROR; - db->flags |= SQLITE_Interrupt; + db->u1.isInterrupted = 1; } return 1; } @@ -1167,7 +1167,7 @@ int sqlite3SafetyOff(sqlite3 *db){ return 0; }else if( db->magic==SQLITE_MAGIC_OPEN ){ db->magic = SQLITE_MAGIC_ERROR; - db->flags |= SQLITE_Interrupt; + db->u1.isInterrupted = 1; } return 1; } diff --git a/src/vdbe.c b/src/vdbe.c index 5fda3338a..203890889 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.570 2006/06/28 18:18:09 drh Exp $ +** $Id: vdbe.c,v 1.571 2006/07/26 01:39:30 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -61,8 +61,8 @@ int sqlite3_search_count = 0; /* ** When this global variable is positive, it gets decremented once before -** each instruction in the VDBE. When reaches zero, the SQLITE_Interrupt -** of the db.flags field is set in order to simulate and interrupt. +** each instruction in the VDBE. When reaches zero, the u1.isInterrupted +** field of the sqlite3 structure is set in order to simulate and interrupt. ** ** This facility is used for testing purposes only. It does not function ** in an ordinary build. @@ -376,7 +376,7 @@ __inline__ unsigned long long int hwtime(void){ ** flag on jump instructions, we get a (small) speed improvement. */ #define CHECK_FOR_INTERRUPT \ - if( db->flags & SQLITE_Interrupt ) goto abort_due_to_interrupt; + if( db->u1.isInterrupted ) goto abort_due_to_interrupt; /* @@ -4970,8 +4970,8 @@ abort_due_to_error: ** flag. */ abort_due_to_interrupt: - assert( db->flags & SQLITE_Interrupt ); - db->flags &= ~SQLITE_Interrupt; + assert( db->u1.isInterrupted ); + db->u1.isInterrupted = 0; if( db->magic!=SQLITE_MAGIC_BUSY ){ rc = SQLITE_MISUSE; }else{ diff --git a/src/vdbeaux.c b/src/vdbeaux.c index e7b005839..08361d185 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -670,8 +670,8 @@ int sqlite3VdbeList( if( i>=p->nOp ){ p->rc = SQLITE_OK; rc = SQLITE_DONE; - }else if( db->flags & SQLITE_Interrupt ){ - db->flags &= ~SQLITE_Interrupt; + }else if( db->u1.isInterrupted ){ + db->u1.isInterrupted = 0; p->rc = SQLITE_INTERRUPT; rc = SQLITE_ERROR; sqlite3SetString(&p->zErrMsg, sqlite3ErrStr(p->rc), (char*)0); |