/ Check-in [4f62dbcf]
Login

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

Overview
Comment:Change code in OP_Rewind to avoid a valgrind warning following an error in the btree layer. This change does not fix any bug, just a warning.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | mistake
Files: files | file ages | folders
SHA1: 4f62dbcfc96855f69e71d163bfc051d9db08cca9
User & Date: dan 2010-07-03 05:56:09
Context
2010-07-03
08:01
Do not attempt to open a WAL file for an in-memory or temporary database. Even if the database header suggests that it is a WAL database. check-in: 0fd80924 user: dan tags: mistake
05:56
Change code in OP_Rewind to avoid a valgrind warning following an error in the btree layer. This change does not fix any bug, just a warning. check-in: 4f62dbcf user: dan tags: mistake
01:44
Fix a buffer overrun in the where.c. Problem detected by valgrind. check-in: 15bb6233 user: drh tags: mistake
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  4244   4244     assert( cursorHoldsMutex(pCur) );
  4245   4245     assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) );
  4246   4246     rc = moveToRoot(pCur);
  4247   4247     if( rc==SQLITE_OK ){
  4248   4248       if( pCur->eState==CURSOR_INVALID ){
  4249   4249         assert( pCur->apPage[pCur->iPage]->nCell==0 );
  4250   4250         *pRes = 1;
  4251         -      rc = SQLITE_OK;
  4252   4251       }else{
  4253   4252         assert( pCur->apPage[pCur->iPage]->nCell>0 );
  4254   4253         *pRes = 0;
  4255   4254         rc = moveToLeftmost(pCur);
  4256   4255       }
  4257   4256     }
  4258   4257     return rc;

Changes to src/vdbe.c.

  4134   4134     VdbeCursor *pC;
  4135   4135     BtCursor *pCrsr;
  4136   4136     int res;
  4137   4137   
  4138   4138     assert( pOp->p1>=0 && pOp->p1<p->nCursor );
  4139   4139     pC = p->apCsr[pOp->p1];
  4140   4140     assert( pC!=0 );
         4141  +  res = 1;
  4141   4142     if( (pCrsr = pC->pCursor)!=0 ){
  4142   4143       rc = sqlite3BtreeFirst(pCrsr, &res);
  4143   4144       pC->atFirst = res==0 ?1:0;
  4144   4145       pC->deferredMoveto = 0;
  4145   4146       pC->cacheStatus = CACHE_STALE;
  4146   4147       pC->rowidIsValid = 0;
  4147         -  }else{
  4148         -    res = 1;
  4149   4148     }
  4150   4149     pC->nullRow = (u8)res;
  4151   4150     assert( pOp->p2>0 && pOp->p2<p->nOp );
  4152   4151     if( res ){
  4153   4152       pc = pOp->p2 - 1;
  4154   4153     }
  4155   4154     break;