1
0
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:
stephan
2023-08-28 12:06:38 +00:00
parent f0e9e59d8d
commit 0d066bc8a6
3 changed files with 16 additions and 12 deletions

View File

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