1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Initial attempt at making sqlite3_interrupt() work even when called from

a separate thread. (CVS 3335)

FossilOrigin-Name: 35fd67d7a0c55797eb460e3bd02c96afe619f026
This commit is contained in:
drh
2006-07-26 01:39:30 +00:00
parent 5bd270b200
commit 881feaa043
8 changed files with 35 additions and 32 deletions

View File

@@ -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;