/ Check-in [167b91df]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Ensure that the nProgressLimit variable is always initialized in sqlite3VdbeExec(), even if the routine jumps to its exit processing early.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 167b91df77fff1a84791f6ab5f72239b90475475be690a838248119b6dd312f0
User & Date: drh 2019-02-12 22:58:32
Context
2019-02-14
15:27
Improved oversized cell detection when updating ptrmap pages in balance_nonroot(). check-in: aa61435a user: drh tags: trunk
2019-02-12
22:58
Ensure that the nProgressLimit variable is always initialized in sqlite3VdbeExec(), even if the routine jumps to its exit processing early. check-in: 167b91df user: drh tags: trunk
21:04
Enhancement the progress callback mechanism so that the progress callback is always invoked at least once at the end of a prepared statement if the opcode count has been exceeded. This makes the progress callback more effective at limiting run times. This check-in also includes and unrelated performance enhancement to OP_Column. check-in: 68cce272 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/vdbe.c.

   618    618   #ifdef VDBE_PROFILE
   619    619     u64 start;                 /* CPU clock count at start of opcode */
   620    620   #endif
   621    621     /*** INSERT STACK UNION HERE ***/
   622    622   
   623    623     assert( p->magic==VDBE_MAGIC_RUN );  /* sqlite3_step() verifies this */
   624    624     sqlite3VdbeEnter(p);
          625  +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
          626  +  if( db->xProgress ){
          627  +    u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP];
          628  +    assert( 0 < db->nProgressOps );
          629  +    nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps);
          630  +  }else{
          631  +    nProgressLimit = 0xffffffff;
          632  +  }
          633  +#endif
   625    634     if( p->rc==SQLITE_NOMEM ){
   626    635       /* This happens if a malloc() inside a call to sqlite3_column_text() or
   627    636       ** sqlite3_column_text16() failed.  */
   628    637       goto no_mem;
   629    638     }
   630    639     assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );
   631    640     assert( p->bIsReader || p->readOnly!=0 );
   632    641     p->iCurrentTime = 0;
   633    642     assert( p->explain==0 );
   634    643     p->pResultSet = 0;
   635    644     db->busyHandler.nBusy = 0;
   636    645     if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
   637    646     sqlite3VdbeIOTraceSql(p);
   638         -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
   639         -  if( db->xProgress ){
   640         -    u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP];
   641         -    assert( 0 < db->nProgressOps );
   642         -    nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps);
   643         -  }else{
   644         -    nProgressLimit = 0xffffffff;
   645         -  }
   646         -#endif
   647    647   #ifdef SQLITE_DEBUG
   648    648     sqlite3BeginBenignMalloc();
   649    649     if( p->pc==0
   650    650      && (p->db->flags & (SQLITE_VdbeListing|SQLITE_VdbeEQP|SQLITE_VdbeTrace))!=0
   651    651     ){
   652    652       int i;
   653    653       int once = 1;