aboutsummaryrefslogtreecommitdiff
path: root/src/where.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2008-03-25 09:47:35 +0000
committerdanielk1977 <danielk1977@noemail.net>2008-03-25 09:47:35 +0000
commitcd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab (patch)
tree6c4d2fa51268edffef783bec9a2f9c689871b82e /src/where.c
parent1e968a0cbf30ea1b0f4d4c5927a8b173d36956d9 (diff)
downloadsqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.tar.gz
sqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.zip
Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912)
FossilOrigin-Name: 047153648155654b0cd70b811935209d2e21776c
Diffstat (limited to 'src/where.c')
-rw-r--r--src/where.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/where.c b/src/where.c
index bcb778509..71bc51bc4 100644
--- a/src/where.c
+++ b/src/where.c
@@ -16,7 +16,7 @@
** so is applicable. Because this module is responsible for selecting
** indices, you might also think of this module as the "query optimizer".
**
-** $Id: where.c,v 1.290 2008/03/17 17:08:33 drh Exp $
+** $Id: where.c,v 1.291 2008/03/25 09:47:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -2223,7 +2223,7 @@ WhereInfo *sqlite3WhereBegin(
Bitmask b = pTabItem->colUsed;
int n = 0;
for(; b; b=b>>1, n++){}
- sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-1, n);
+ sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-2, n);
assert( n<=pTab->nCol );
}
}else{
@@ -2233,10 +2233,10 @@ WhereInfo *sqlite3WhereBegin(
if( (pIx = pLevel->pIdx)!=0 ){
KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx);
assert( pIx->pSchema==pTab->pSchema );
+ sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, pIx->nColumn+1);
sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb,
(char*)pKey, P4_KEYINFO_HANDOFF);
VdbeComment((v, "%s", pIx->zName));
- sqlite3VdbeAddOp2(v, OP_SetNumColumns, iIdxCur, pIx->nColumn+1);
}
sqlite3CodeVerifySchema(pParse, iDb);
}