1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Increase the resolution of the vdbe opcode counters to 64 bits, as

apparently some users run single prepared statements that go for
longer than 4 billion instructions.  See forum post 
"[https://sqlite.org/forum/forumpost/d07949dc94|Possible freeze in the progress loop]"

FossilOrigin-Name: 612eb590ea44fd402e630f2d62558beb7ce57d7d0ba113c8b72ea60a895c5a43
This commit is contained in:
drh
2020-07-06 12:13:05 +00:00
parent a78d2c0528
commit d1d89140c0
4 changed files with 14 additions and 12 deletions

View File

@@ -671,9 +671,9 @@ int sqlite3VdbeExec(
u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */
u8 encoding = ENC(db); /* The database encoding */
int iCompare = 0; /* Result of last comparison */
unsigned nVmStep = 0; /* Number of virtual machine steps */
u64 nVmStep = 0; /* Number of virtual machine steps */
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
unsigned nProgressLimit; /* Invoke xProgress() when nVmStep reaches this */
u64 nProgressLimit; /* Invoke xProgress() when nVmStep reaches this */
#endif
Mem *aMem = p->aMem; /* Copy of p->aMem */
Mem *pIn1 = 0; /* 1st input operand */
@@ -693,7 +693,7 @@ int sqlite3VdbeExec(
assert( 0 < db->nProgressOps );
nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps);
}else{
nProgressLimit = 0xffffffff;
nProgressLimit = LARGEST_UINT64;
}
#endif
if( p->rc==SQLITE_NOMEM ){
@@ -905,7 +905,7 @@ check_for_interrupt:
assert( db->nProgressOps!=0 );
nProgressLimit += db->nProgressOps;
if( db->xProgress(db->pProgressArg) ){
nProgressLimit = 0xffffffff;
nProgressLimit = LARGEST_UINT64;
rc = SQLITE_INTERRUPT;
goto abort_due_to_error;
}
@@ -8001,7 +8001,7 @@ vdbe_return:
while( nVmStep>=nProgressLimit && db->xProgress!=0 ){
nProgressLimit += db->nProgressOps;
if( db->xProgress(db->pProgressArg) ){
nProgressLimit = 0xffffffff;
nProgressLimit = LARGEST_UINT64;
rc = SQLITE_INTERRUPT;
goto abort_due_to_error;
}