aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vdbe.c4
-rw-r--r--src/vdbeInt.h5
-rw-r--r--src/vdbeaux.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index 1cc0a422c..81f552998 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -6264,9 +6264,9 @@ case OP_IdxRowid: { /* out2 */
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
pC = p->apCsr[pOp->p1];
assert( pC!=0 );
- assert( pC->eCurType==CURTYPE_BTREE );
+ assert( pC->eCurType==CURTYPE_BTREE || IsNullCursor(pC) );
assert( pC->uc.pCursor!=0 );
- assert( pC->isTable==0 );
+ assert( pC->isTable==0 || IsNullCursor(pC) );
assert( pC->deferredMoveto==0 );
assert( !pC->nullRow || pOp->opcode==OP_IdxRowid );
diff --git a/src/vdbeInt.h b/src/vdbeInt.h
index b07aee0c0..2a2e40317 100644
--- a/src/vdbeInt.h
+++ b/src/vdbeInt.h
@@ -134,6 +134,11 @@ struct VdbeCursor {
u32 aType[1]; /* Type values record decode. MUST BE LAST */
};
+/* Return true if P is a null-only cursor
+*/
+#define IsNullCursor(P) \
+ ((P)->eCurType==CURTYPE_PSEUDO && (P)->nullRow && (P)->seekResult==0)
+
/*
** A value for VdbeCursor.cacheStatus that means the cache is always invalid.
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index cb2433c2c..f598b0d54 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -3549,7 +3549,7 @@ int SQLITE_NOINLINE sqlite3VdbeHandleMovedCursor(VdbeCursor *p){
** if need be. Return any I/O error from the restore operation.
*/
int sqlite3VdbeCursorRestore(VdbeCursor *p){
- assert( p->eCurType==CURTYPE_BTREE );
+ assert( p->eCurType==CURTYPE_BTREE || IsNullCursor(p) );
if( sqlite3BtreeCursorHasMoved(p->uc.pCursor) ){
return sqlite3VdbeHandleMovedCursor(p);
}