diff options
author | stephan <stephan@noemail.net> | 2023-08-28 12:06:38 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-08-28 12:06:38 +0000 |
commit | 0d066bc8a626eb9a94ea289a78df7f825b9510d9 (patch) | |
tree | 9b1a89a873edff877313712e83d35c7ee4b7cb45 /src | |
parent | f0e9e59d8d3786db5347ad285b73a77e4d6c8bb1 (diff) | |
download | sqlite-0d066bc8a626eb9a94ea289a78df7f825b9510d9.tar.gz sqlite-0d066bc8a626eb9a94ea289a78df7f825b9510d9.zip |
Resolve a condition which could cause an is-interrupted db to call its progress callback.
FossilOrigin-Name: a0d0f1aafc6086726131dff5e6628f2771c20db3122a53bdbb82945ab5d326d1
Diffstat (limited to 'src')
-rw-r--r-- | src/util.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/util.c b/src/util.c index 97deb64cf..7f8a33f9c 100644 --- a/src/util.c +++ b/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 } |