aboutsummaryrefslogtreecommitdiff
path: root/src/vdbe.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-07-11 21:02:53 +0000
committerdrh <drh@noemail.net>2008-07-11 21:02:53 +0000
commita34605859d16febe0b51db0231827cd0458f55b3 (patch)
tree122be86383110e49ba55ec92fade12274fc4c643 /src/vdbe.c
parentf46080903008c923aaba6936590ab27ad80d0e4b (diff)
downloadsqlite-a34605859d16febe0b51db0231827cd0458f55b3.tar.gz
sqlite-a34605859d16febe0b51db0231827cd0458f55b3.zip
Detect and handles the case where a row is modified or deleted while it
is being read during SELECT processing. (CVS 5399) FossilOrigin-Name: c80a5d09935c60a2a50bc262c172a94073355f0d
Diffstat (limited to 'src/vdbe.c')
-rw-r--r--src/vdbe.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index ac3e20868..d65995be0 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
-** $Id: vdbe.c,v 1.760 2008/07/10 00:32:42 drh Exp $
+** $Id: vdbe.c,v 1.761 2008/07/11 21:02:54 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1670,7 +1670,6 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */
int flags;
int res;
char affinity;
- Mem x1, x3;
flags = pIn1->flags|pIn3->flags;
@@ -3808,6 +3807,7 @@ case OP_Prev: /* jump */
case OP_Next: { /* jump */
Cursor *pC;
BtCursor *pCrsr;
+ int res;
CHECK_FOR_INTERRUPT;
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
@@ -3817,19 +3817,17 @@ case OP_Next: { /* jump */
}
pCrsr = pC->pCursor;
assert( pCrsr );
- if( pC->nullRow==0 ){
- int res = 1;
- assert( pC->deferredMoveto==0 );
- rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
- sqlite3BtreePrevious(pCrsr, &res);
- pC->nullRow = res;
- pC->cacheStatus = CACHE_STALE;
- if( res==0 ){
- pc = pOp->p2 - 1;
+ res = 1;
+ assert( pC->deferredMoveto==0 );
+ rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) :
+ sqlite3BtreePrevious(pCrsr, &res);
+ pC->nullRow = res;
+ pC->cacheStatus = CACHE_STALE;
+ if( res==0 ){
+ pc = pOp->p2 - 1;
#ifdef SQLITE_TEST
- sqlite3_search_count++;
+ sqlite3_search_count++;
#endif
- }
}
pC->rowidIsValid = 0;
break;