1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix sqlite3_prepare() so that it only invokes the progress handler on every

N-th call to sqlite3ProgressCheck(), where N is the progress handler step
count.  Also fix faulty asserts exposed by the ability to interrupt in the
middle of sqlite3_prepare().

FossilOrigin-Name: 05461651599bb490ac6cfd893645dabab9cccedc6adcce15aee2487b2ea6027a
This commit is contained in:
drh
2023-01-12 19:51:49 +00:00
parent f84cbd1676
commit 2fc9dc9330
8 changed files with 27 additions and 20 deletions

View File

@@ -185,9 +185,12 @@ void sqlite3ProgressCheck(Parse *p){
p->rc = SQLITE_INTERRUPT;
}
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
if( db->xProgress && db->xProgress(db->pProgressArg) ){
p->nErr++;
p->rc = SQLITE_INTERRUPT;
if( db->xProgress && (++p->nProgressSteps)>=db->nProgressOps ){
if( db->xProgress(db->pProgressArg) ){
p->nErr++;
p->rc = SQLITE_INTERRUPT;
}
p->nProgressSteps = 0;
}
#endif
}