From: drh Date: Tue, 21 Feb 2017 14:04:40 +0000 (+0000) Subject: The VDBE cycle counts for the sqlite3_progress_handler() callback are now X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fcumulative-progress-count;p=thirdparty%2Fsqlite.git The VDBE cycle counts for the sqlite3_progress_handler() callback are now cumulative. Leftovers from the previous statement are applied to the next statement. FossilOrigin-Name: 7a62fc6abcfe1459123c09eae48976dadaa2d4b3 --- diff --git a/manifest b/manifest index b9e136d680..946770901e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Correct\sa\sharmless\stypo\sin\sthe\sprevious\scheck-in. -D 2017-02-20T23:32:04.979 +C The\sVDBE\scycle\scounts\sfor\sthe\ssqlite3_progress_handler()\scallback\sare\snow\ncumulative.\s\sLeftovers\sfrom\sthe\sprevious\sstatement\sare\sapplied\sto\sthe\snext\nstatement. +D 2017-02-21T14:04:40.431 F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc a89ea37ab5928026001569f056973b9059492fe2 @@ -399,7 +399,7 @@ F src/shell.c bf976d5301be9d8a4c52852c97909cc9a41ee20d F src/sqlite.h.in 751ff125eb159c8f92c182b8df980a5e4f50e966 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 8648034aa702469afb553231677306cc6492a1ae -F src/sqliteInt.h 46fe8e5aee3825d77fa771216ef263dc947030e7 +F src/sqliteInt.h 15f78048a1c8cbe0027a69d60ed3c92e9e7eb27e F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247 F src/status.c a9e66593dfb28a9e746cba7153f84d49c1ddc4b1 F src/table.c b46ad567748f24a326d9de40e5b9659f96ffff34 @@ -461,7 +461,7 @@ F src/update.c 456d4a4656f8a03c2abc88a51b19172197400e58 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c F src/util.c ca8440ede81e155d15cff7c101654f60b55a9ae6 F src/vacuum.c 1fe4555cd8c9b263afb85b5b4ee3a4a4181ad569 -F src/vdbe.c 16f378640570c24442fd7191b136b5d6380f5c7b +F src/vdbe.c aab9f3ca2d1e4ecc052232697393305e2fbf256b F src/vdbe.h 59998ffd71d7caa8886bc78dafaf8caeccd4c13c F src/vdbeInt.h 4e4b15b2e1330e1636e4e01974eab2b0b985092f F src/vdbeapi.c 3e4a8893feeb78620f4aac4ac5b85d92255b97e1 @@ -1556,7 +1556,10 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 96b6a98e5e4cb0ddbfcd78b05bfbfcd8976e9f32 -R a6d884232566cde130b9b77412776230 -U mistachkin -Z c97450fc686b8c32bf5204625d8622fc +P 1589db012ef1389bf84399fccf96d143b2ac4c0f +R 5142727fa68f4d8f31618eaf0dc5d893 +T *branch * cumulative-progress-count +T *sym-cumulative-progress-count * +T -sym-trunk * +U drh +Z 77af1e5e5bb5d81b67cd1fb30eb348ef diff --git a/manifest.uuid b/manifest.uuid index a4b5b98287..dfcc98d82e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -1589db012ef1389bf84399fccf96d143b2ac4c0f \ No newline at end of file +7a62fc6abcfe1459123c09eae48976dadaa2d4b3 \ No newline at end of file diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 9a53d33626..68ea9a3056 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1391,6 +1391,7 @@ struct sqlite3 { int (*xProgress)(void *); /* The progress callback */ void *pProgressArg; /* Argument to the progress callback */ unsigned nProgressOps; /* Number of opcodes for progress callback */ + unsigned iProgressCnt; /* Current progress counter value */ #endif #ifndef SQLITE_OMIT_VIRTUALTABLE int nVTrans; /* Allocated size of aVTrans */ diff --git a/src/vdbe.c b/src/vdbe.c index 7f286b2c6d..b5c2866358 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -605,7 +605,9 @@ int sqlite3VdbeExec( sqlite3VdbeIOTraceSql(p); #ifndef SQLITE_OMIT_PROGRESS_CALLBACK if( db->xProgress ){ - u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP]; + u32 iPrior; + if( p->pc==0 && db->nVdbeActive==1 ) db->iProgressCnt = 0; + iPrior = db->iProgressCnt; assert( 0 < db->nProgressOps ); nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps); } @@ -7048,6 +7050,9 @@ abort_due_to_error: vdbe_return: testcase( nVmStep>0 ); p->aCounter[SQLITE_STMTSTATUS_VM_STEP] += (int)nVmStep; +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + db->iProgressCnt += (int)nVmStep; +#endif sqlite3VdbeLeave(p); assert( rc!=SQLITE_OK || nExtraDelete==0 || sqlite3_strlike("DELETE%",p->zSql,0)!=0