mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Resolve a condition which could cause an is-interrupted db to call its progress callback.
FossilOrigin-Name: a0d0f1aafc6086726131dff5e6628f2771c20db3122a53bdbb82945ab5d326d1
This commit is contained in:
14
src/util.c
14
src/util.c
@@ -202,12 +202,16 @@ void sqlite3ProgressCheck(Parse *p){
|
||||
p->rc = SQLITE_INTERRUPT;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
if( db->xProgress && (++p->nProgressSteps)>=db->nProgressOps ){
|
||||
if( db->xProgress(db->pProgressArg) ){
|
||||
p->nErr++;
|
||||
p->rc = SQLITE_INTERRUPT;
|
||||
if( db->xProgress ){
|
||||
if( p->rc==SQLITE_INTERRUPT ){
|
||||
p->nProgressSteps = 0;
|
||||
}else if( (++p->nProgressSteps)>=db->nProgressOps ){
|
||||
if( db->xProgress(db->pProgressArg) ){
|
||||
p->nErr++;
|
||||
p->rc = SQLITE_INTERRUPT;
|
||||
}
|
||||
p->nProgressSteps = 0;
|
||||
}
|
||||
p->nProgressSteps = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user