diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index 23c6b1a66..a648c3a81 100644 --- a/src/util.c +++ b/src/util.c @@ -176,6 +176,23 @@ void sqlite3ErrorWithMsg(sqlite3 *db, int err_code, const char *zFormat, ...){ } /* +** Check for interrupts and invoke progress callback. +*/ +void sqlite3ProgressCheck(Parse *p){ + sqlite3 *db = p->db; + if( AtomicLoad(&db->u1.isInterrupted) ){ + p->nErr++; + p->rc = SQLITE_INTERRUPT; + } +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + if( db->xProgress && db->xProgress(db->pProgressArg) ){ + p->nErr++; + p->rc = SQLITE_INTERRUPT; + } +#endif +} + +/* ** Add an error message to pParse->zErrMsg and increment pParse->nErr. ** ** This function should be used to report any error that occurs while |