-C Fix\sEXPLAIN\sand\sEXPLAIN\squery\splan\sto\swork\swith\snew\sopcode\sformat.\s(CVS\s4662)
-D 2008-01-03T07:09:48
+C Change\sOP_OpenRead\sand\sOP_OpenWrite\sso\sthat\sthe\sdatabase\snumber\sis\sread\sfrom\sthe\sP3\soperand,\snot\sthe\sstack.\s(CVS\s4663)
+D 2008-01-03T07:54:24
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 30789bf70614bad659351660d76b8e533f3340e9
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F sqlite3.def a96c1d0d39362b763d2ddba220a32da41a15c4b4
F sqlite3.pc.in abed4664817e1cd500f2276142c71958087c16bc
F src/alter.c b58ed3becc77885e2aec6754c689255534f2734c
-F src/analyze.c 09e55b6bd3fe6a05fac7f471d21da344e9a0a92b
+F src/analyze.c 1fb7ada6a10c252db873c0835fbd92caaaa65116
F src/attach.c 4b214b411237531491e1186211e005e4de73630d
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
F src/btmutex.c 5d39da37c9d1282f3c6f9967afae6a34ee36b7ff
F src/btree.c 5164b32950cfd41f2c5c31e8ff82c4a499918aef
F src/btree.h 19dcf5ad23c17b98855da548e9a8e3eb4429d5eb
F src/btreeInt.h 1c5a9da165718ef7de81e35ce9ab5d9ba9283f76
-F src/build.c 043c36a387e5bb73b14209b7a0cfeb1f7892d3a2
+F src/build.c a34fc6b288115b36e7b32dc2da429cbb59c89098
F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0
F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
F src/date.c 49c5a6d2de6c12000905b4d36868b07d3011bbf6
-F src/delete.c 4d3e382146a1753b7de27c0554fc366cffef8b16
+F src/delete.c 0daad58124d0dfb334c8e5d3f6ceb76f093b8723
F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
-F src/expr.c 4bfb33eeef12c373ecf477aef199ec9e114b09dc
+F src/expr.c 24202e79a92c8b9b0b5a609d03051ff3d91e5bf4
F src/func.c 996071cf0af9d967e58b69fce1909555059ebc7d
F src/hash.c 45a7005aac044b6c86bd7e49c44bc15d30006d6c
F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
-F src/insert.c 6c8bbffdfaf74dfd558dafe6109a4d17533502a8
+F src/insert.c c76fbbed6f3d3721dcc528653e45ff6c08a24c83
F src/journal.c 807bed7a158979ac8d63953e1774e8d85bff65e2
F src/legacy.c 4ac53191fad2e3c4d59bde1228879b2dc5a96d66
F src/limits.h 71ab25f17e35e0a9f3f6f234b8ed49cc56731d35
F src/prepare.c f1bb8eb642082e618a359c08e3e107490eafe0e3
F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
-F src/select.c fb57c9f49f5a117a1680dd4dd517e1e8631baf68
+F src/select.c 1f8579efbb45c037d1b169d08ac9e4cab84e1d74
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 5391e889384d2062249f668110d64ed16f601c4b
F src/sqlite.h.in 2a7e3776534bbe6ff2cdc058f3abebe91e7e429f
F src/test_thread.c e297dd41db0b249646e69f97d36ec13e56e8b730
F src/tokenize.c a4e04438c11fed2c67ec47fe3edbef9cca2d1b48
F src/trigger.c e7642cf61056655905aaba8db1ca51d299a1003b
-F src/update.c 39ac597c81b1d7d0396d5571d620bfa694f21151
+F src/update.c c67129529717f420f2955d735e04bb4d28aa2e7b
F src/utf.c ef4b7d83bae533b76c3e1bf635b113fdad86a736
F src/util.c 05f31144bbd3f1a24f4139ae029c42545cb72624
F src/vacuum.c 3f34f278809bf3eb0b62ec46ff779e9c385b28f0
-F src/vdbe.c 83dfa6980067dca0750b87d374a898ea199c4fa5
-F src/vdbe.h 0d29000e30e60714f8de9fd4373ec8569c728e07
+F src/vdbe.c 847acbfd9d55a59725fb02c004af8158a9cd09a0
+F src/vdbe.h ad5fd7aa694928e54efa84ac8f8133b77053c97d
F src/vdbeInt.h 2985f1369273e635898cf5952237efcb3fdb21f3
F src/vdbeapi.c bf615ff2cf2b121f1609cbadd4f52720289733b5
-F src/vdbeaux.c 5d04881cd87f0efa51bc0dd3a9b2db261ab0e9c2
-F src/vdbeblob.c 82f51cdf9b0c0af729732fde48c824e498c0a1ca
+F src/vdbeaux.c f31d1dbbbf98eadf0a616829d0d1456a96079316
+F src/vdbeblob.c b90f7494c408d47ce6835000b01e40b371e27baf
F src/vdbefifo.c 334c838c8f42d61a94813d136019ee566b5dc2f6
F src/vdbemem.c 123994fcd344993d2fb050a83b91b341bbbd08b4
F src/vtab.c 03014b2bfa8096ecac5fcdc80d34cd76e06af52a
-F src/where.c 09edd04e2c6eeb6dcb6f634eef4a1d062d103988
+F src/where.c 6b1d4acf10e3a9ba0424a03812fe35d75d45c0e6
F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
F test/all.test ee350b9ab15b175fc0a8fb51bf2141ed3a3b9cba
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 4dc507d87b242619fe32606452227900e16a6de7
-R 125024a4bb4ac98d08154804cd32abf6
+P b166c33a7b9a58d571619d2248019eda09651dd2
+R 8be529e6a54294a6d1844c01bcfcfc53
U danielk1977
-Z 42b14c9552be08386812f3638911e78b
+Z d1a83a5d28422a97fb0c22148135704a
-b166c33a7b9a58d571619d2248019eda09651dd2
\ No newline at end of file
+35da261daf602b1e938f05bbad1ff99213d9f4b9
\ No newline at end of file
*************************************************************************
** This file contains code associated with the ANALYZE command.
**
-** @(#) $Id: analyze.c,v 1.27 2008/01/03 00:01:24 drh Exp $
+** @(#) $Id: analyze.c,v 1.28 2008/01/03 07:54:24 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_ANALYZE
#include "sqliteInt.h"
if( iRootPage>0 ){
sqlite3TableLock(pParse, iDb, iRootPage, 1, "sqlite_stat1");
}
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
- sqlite3VdbeAddOp2(v, OP_OpenWrite, iStatCur, iRootPage);
+ sqlite3VdbeAddOp3(v, OP_OpenWrite, iStatCur, iRootPage, iDb);
sqlite3VdbeAddOp2(v, OP_SetNumColumns, iStatCur, 3);
}
/* Open a cursor to the index to be analyzed
*/
assert( iDb==sqlite3SchemaToIndex(pParse->db, pIdx->pSchema) );
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
- VdbeComment((v, "%s", pIdx->zName));
- sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIdx->tnum, iDb,
(char *)pKey, P4_KEYINFO_HANDOFF);
+ VdbeComment((v, "%s", pIdx->zName));
nCol = pIdx->nColumn;
if( iMem+nCol*2>=pParse->nMem ){
pParse->nMem = iMem+nCol*2+1;
** COMMIT
** ROLLBACK
**
-** $Id: build.c,v 1.453 2008/01/03 00:01:24 drh Exp $
+** $Id: build.c,v 1.454 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
void sqlite3OpenMasterTable(Parse *p, int iDb){
Vdbe *v = sqlite3GetVdbe(p);
sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(iDb));
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
- sqlite3VdbeAddOp2(v, OP_OpenWrite, 0, MASTER_ROOT);
+ sqlite3VdbeAddOp3(v, OP_OpenWrite, 0, MASTER_ROOT, iDb);
sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, 5); /* sqlite_master has 5 columns */
}
SelectDest dest = {SRT_Table, 1, 0};
Table *pSelTab;
sqlite3VdbeAddOp1(v, OP_Dup, 0);
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
- sqlite3VdbeAddOp2(v, OP_OpenWrite, 1, 0);
+ sqlite3VdbeAddOp3(v, OP_OpenWrite, 1, 0, iDb);
pParse->nTab = 2;
sqlite3Select(pParse, pSelect, &dest, 0, 0, 0, 0);
sqlite3VdbeAddOp1(v, OP_Close, 1);
tnum = pIndex->tnum;
sqlite3VdbeAddOp2(v, OP_Clear, tnum, iDb);
}
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
pKey = sqlite3IndexKeyinfo(pParse, pIndex);
- sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenWrite, iIdx, tnum, iDb,
(char *)pKey, P4_KEYINFO_HANDOFF);
sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead);
addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0);
** This file contains C code routines that are called by the parser
** in order to generate code for DELETE FROM statements.
**
-** $Id: delete.c,v 1.140 2008/01/03 00:01:24 drh Exp $
+** $Id: delete.c,v 1.141 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
v = sqlite3GetVdbe(p);
assert( opcode==OP_OpenWrite || opcode==OP_OpenRead );
sqlite3TableLock(p, iDb, pTab->tnum, (opcode==OP_OpenWrite), pTab->zName);
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
+ sqlite3VdbeAddOp3(v, opcode, iCur, pTab->tnum, iDb);
VdbeComment((v, "%s", pTab->zName));
- sqlite3VdbeAddOp2(v, opcode, iCur, pTab->tnum);
sqlite3VdbeAddOp2(v, OP_SetNumColumns, iCur, pTab->nCol);
}
** This file contains routines used for analyzing expressions and
** for generating VDBE code that evaluates expressions in SQLite.
**
-** $Id: expr.c,v 1.325 2008/01/03 00:01:24 drh Exp $
+** $Id: expr.c,v 1.326 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
iAddr = sqlite3VdbeAddOp2(v, OP_If, 0, iMem);
sqlite3VdbeAddOp2(v, OP_MemInt, 1, iMem);
- sqlite3VdbeAddOp1(v, OP_Integer, iDb);
- VdbeComment((v, "%s", pIdx->zName));
- sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb,
pKey,P4_KEYINFO_HANDOFF);
+ VdbeComment((v, "%s", pIdx->zName));
eType = IN_INDEX_INDEX;
sqlite3VdbeAddOp2(v, OP_SetNumColumns, iTab, pIdx->nColumn);
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.202 2008/01/03 00:01:24 drh Exp $
+** $Id: insert.c,v 1.203 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
for(i=iStartAddr; i<iEnd; i++){
VdbeOp *pOp = sqlite3VdbeGetOp(v, i);
assert( pOp!=0 );
- if( pOp->opcode==OP_OpenRead ){
- VdbeOp *pPrior = &pOp[-1];
+ if( pOp->opcode==OP_OpenRead && pOp->p3==iDb ){
+ Index *pIndex;
int tnum = pOp->p2;
- assert( i>iStartAddr );
- assert( pPrior->opcode==OP_Integer );
- if( pPrior->p1==iDb ){
- Index *pIndex;
- if( tnum==pTab->tnum ){
+ if( tnum==pTab->tnum ){
+ return 1;
+ }
+ for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
+ if( tnum==pIndex->tnum ){
return 1;
}
- for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
- if( tnum==pIndex->tnum ){
- return 1;
- }
- }
}
}
#ifndef SQLITE_OMIT_VIRTUALTABLE
memId = pParse->nMem+1;
pParse->nMem += 2;
sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
- sqlite3VdbeAddOp2(v, OP_Rewind, iCur, addr+13);
+ sqlite3VdbeAddOp2(v, OP_Rewind, iCur, addr+12);
sqlite3VdbeAddOp2(v, OP_Column, iCur, 0);
sqlite3VdbeAddOp4(v, OP_String8, 0, 0, 0, pTab->zName, 0);
- sqlite3VdbeAddOp2(v, OP_Ne, 0x100, addr+12);
+ sqlite3VdbeAddOp2(v, OP_Ne, 0x100, addr+11);
sqlite3VdbeAddOp2(v, OP_Rowid, iCur, 0);
sqlite3VdbeAddOp2(v, OP_MemStore, memId-1, 1);
sqlite3VdbeAddOp2(v, OP_Column, iCur, 1);
sqlite3VdbeAddOp2(v, OP_MemStore, memId, 1);
- sqlite3VdbeAddOp2(v, OP_Goto, 0, addr+13);
- sqlite3VdbeAddOp2(v, OP_Next, iCur, addr+4);
+ sqlite3VdbeAddOp2(v, OP_Goto, 0, addr+12);
+ sqlite3VdbeAddOp2(v, OP_Next, iCur, addr+3);
sqlite3VdbeAddOp2(v, OP_Close, iCur, 0);
}
return memId;
addr = sqlite3VdbeCurrentAddr(v);
sqlite3OpenTable(pParse, iCur, iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
sqlite3VdbeAddOp2(v, OP_MemLoad, memId-1, 0);
- sqlite3VdbeAddOp2(v, OP_NotNull, -1, addr+7);
+ sqlite3VdbeAddOp2(v, OP_NotNull, -1, addr+6);
sqlite3VdbeAddOp2(v, OP_Pop, 1, 0);
sqlite3VdbeAddOp2(v, OP_NewRowid, iCur, 0);
sqlite3VdbeAddOp4(v, OP_String8, 0, 0, 0, pTab->zName, 0);
for(i=1, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
assert( pIdx->pSchema==pTab->pSchema );
- sqlite3VdbeAddOp2(v, OP_Integer, iDb, 0);
- VdbeComment((v, "%s", pIdx->zName));
- sqlite3VdbeAddOp4(v, op, i+base, pIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, op, i+base, pIdx->tnum, iDb,
(char*)pKey, P4_KEYINFO_HANDOFF);
+ VdbeComment((v, "%s", pIdx->zName));
}
if( pParse->nTab<=base+i ){
pParse->nTab = base+i;
assert( pSrcIdx );
sqlite3VdbeAddOp2(v, OP_Close, iSrc, 0);
sqlite3VdbeAddOp2(v, OP_Close, iDest, 0);
- sqlite3VdbeAddOp2(v, OP_Integer, iDbSrc, 0);
pKey = sqlite3IndexKeyinfo(pParse, pSrcIdx);
- VdbeComment((v, "%s", pSrcIdx->zName));
- sqlite3VdbeAddOp4(v, OP_OpenRead, iSrc, pSrcIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenRead, iSrc, pSrcIdx->tnum, iDbSrc,
(char*)pKey, P4_KEYINFO_HANDOFF);
- sqlite3VdbeAddOp2(v, OP_Integer, iDbDest, 0);
+ VdbeComment((v, "%s", pSrcIdx->zName));
pKey = sqlite3IndexKeyinfo(pParse, pDestIdx);
- VdbeComment((v, "%s", pDestIdx->zName));
- sqlite3VdbeAddOp4(v, OP_OpenWrite, iDest, pDestIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenWrite, iDest, pDestIdx->tnum, iDbDest,
(char*)pKey, P4_KEYINFO_HANDOFF);
+ VdbeComment((v, "%s", pDestIdx->zName));
addr1 = sqlite3VdbeAddOp2(v, OP_Rewind, iSrc, 0);
sqlite3VdbeAddOp2(v, OP_RowKey, iSrc, 0);
sqlite3VdbeAddOp2(v, OP_IdxInsert, iDest, 1);
** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite.
**
-** $Id: select.c,v 1.378 2008/01/03 00:01:25 drh Exp $
+** $Id: select.c,v 1.379 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
iIdx = pParse->nTab++;
assert( pIdx->pSchema==pTab->pSchema );
- sqlite3VdbeAddOp2(v, OP_Integer, iDb, 0);
- sqlite3VdbeAddOp4(v, OP_OpenRead, iIdx, pIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenRead, iIdx, pIdx->tnum, iDb,
(char*)pKey, P4_KEYINFO_HANDOFF);
if( seekOp==OP_Rewind ){
sqlite3VdbeAddOp2(v, OP_Null, 0, 0);
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.149 2008/01/03 00:01:25 drh Exp $
+** $Id: update.c,v 1.150 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
if( openAll || aIdxUsed[i] ){
KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIdx);
- sqlite3VdbeAddOp2(v, OP_Integer, iDb, 0);
- sqlite3VdbeAddOp4(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, 0,
+ sqlite3VdbeAddOp4(v, OP_OpenWrite, iCur+i+1, pIdx->tnum, iDb,
(char*)pKey, P4_KEYINFO_HANDOFF);
assert( pParse->nTab>iCur+i+1 );
}
** 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.665 2008/01/03 07:09:48 danielk1977 Exp $
+** $Id: vdbe.c,v 1.666 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
break;
}
-/* Opcode: OpenRead P1 P2 P4
+/* Opcode: OpenRead P1 P2 P3 P4 *
**
** Open a read-only cursor for the database table whose root page is
-** P2 in a database file. The database file is determined by an
-** integer from the top of the stack. 0 means the main database and
-** 1 means the database used for temporary tables. Give the new
-** cursor an identifier of P1. The P1 values need not be contiguous
-** but all P1 values should be small integers. It is an error for
-** P1 to be negative.
+** P2 in a database file. The database file is determined by P3.
+** 0 means the main database and 1 means the database used for
+** temporary tables. Give the new cursor an identifier of P1. The P1
+** values need not be contiguous but all P1 values should be small integers.
+** It is an error for P1 to be negative.
**
-** If P2==0 then take the root page number from the next of the stack.
+** If P2==0 then take the root page number from the top of the stack.
**
** There will be a read lock on the database whenever there is an
** open cursor. If the database was unlocked prior to this instruction
**
** See also OpenWrite.
*/
-/* Opcode: OpenWrite P1 P2 P4
+/* Opcode: OpenWrite P1 P2 P3 P4 *
**
** Open a read/write cursor named P1 on the table or index whose root
** page is P2. If P2==0 then take the root page number from the stack.
case OP_OpenWrite: { /* no-push */
int i = pOp->p1;
int p2 = pOp->p2;
+ int iDb = pOp->p3;
int wrFlag;
Btree *pX;
- int iDb;
Cursor *pCur;
Db *pDb;
- assert( pTos>=p->aStack );
- sqlite3VdbeMemIntegerify(pTos);
- iDb = pTos->u.i;
- assert( (pTos->flags & MEM_Dyn)==0 );
- pTos--;
assert( iDb>=0 && iDb<db->nDb );
assert( (p->btreeMask & (1<<iDb))!=0 );
pDb = &db->aDb[iDb];
case SQLITE_BUSY: {
p->pc = pc;
p->rc = rc = SQLITE_BUSY;
- p->pTos = &pTos[1 + (pOp->p2<=0)]; /* Operands must remain on stack */
+ p->pTos = &pTos[(pOp->p2<=0)]; /* Operands must remain on stack */
goto vdbe_return;
}
case SQLITE_OK: {
** or VDBE. The VDBE implements an abstract machine that runs a
** simple program to access and modify the underlying database.
**
-** $Id: vdbe.h,v 1.119 2008/01/03 01:28:59 drh Exp $
+** $Id: vdbe.h,v 1.120 2008/01/03 07:54:24 danielk1977 Exp $
*/
#ifndef _SQLITE_VDBE_H_
#define _SQLITE_VDBE_H_
int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp);
void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1);
void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2);
+void sqlite3VdbeChangeP3(Vdbe*, int addr, int P2);
void sqlite3VdbeJumpHere(Vdbe*, int addr);
void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N);
void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N);
}
}
+/*
+** Change the value of the P2 operand for a specific instruction.
+** This routine is useful for setting a jump destination.
+*/
+void sqlite3VdbeChangeP3(Vdbe *p, int addr, int val){
+ assert( p==0 || p->magic==VDBE_MAGIC_INIT );
+ if( p && addr>=0 && p->nOp>addr && p->aOp ){
+ p->aOp[addr].p3 = val;
+ }
+}
+
/*
** Change the P2 operand of instruction addr so that it points to
** the address of the next instruction to be coded.
**
** This file contains code used to implement incremental BLOB I/O.
**
-** $Id: vdbeblob.c,v 1.16 2007/08/30 01:19:59 drh Exp $
+** $Id: vdbeblob.c,v 1.17 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
static const VdbeOpList openBlob[] = {
{OP_Transaction, 0, 0, 0}, /* 0: Start a transaction */
{OP_VerifyCookie, 0, 0, 0}, /* 1: Check the schema cookie */
- {OP_Integer, 0, 0, 0}, /* 2: Database number */
/* One of the following two instructions is replaced by an
** OP_Noop before exection.
*/
- {OP_OpenRead, 0, 0, 0}, /* 3: Open cursor 0 for reading */
- {OP_OpenWrite, 0, 0, 0}, /* 4: Open cursor 0 for read/write */
- {OP_SetNumColumns, 0, 0, 0}, /* 5: Num cols for cursor */
-
- {OP_Variable, 1, 0, 0}, /* 6: Push the rowid to the stack */
- {OP_NotExists, 0, 10, 0}, /* 7: Seek the cursor */
- {OP_Column, 0, 0, 0}, /* 8 */
- {OP_Callback, 0, 0, 0}, /* 9 */
- {OP_Close, 0, 0, 0}, /* 10 */
- {OP_Halt, 0, 0, 0}, /* 11 */
+ {OP_OpenRead, 0, 0, 0}, /* 2: Open cursor 0 for reading */
+ {OP_OpenWrite, 0, 0, 0}, /* 3: Open cursor 0 for read/write */
+ {OP_SetNumColumns, 0, 0, 0}, /* 4: Num cols for cursor */
+
+ {OP_Variable, 1, 0, 0}, /* 5: Push the rowid to the stack */
+ {OP_NotExists, 0, 10, 0}, /* 6: Seek the cursor */
+ {OP_Column, 0, 0, 0}, /* 7 */
+ {OP_Callback, 0, 0, 0}, /* 8 */
+ {OP_Close, 0, 0, 0}, /* 9 */
+ {OP_Halt, 0, 0, 0}, /* 10 */
};
Vdbe *v = 0;
/* Make sure a mutex is held on the table to be accessed */
sqlite3VdbeUsesBtree(v, iDb);
- /* Configure the db number pushed onto the stack */
- sqlite3VdbeChangeP1(v, 2, iDb);
-
/* Remove either the OP_OpenWrite or OpenRead. Set the P2
** parameter of the other to pTab->tnum.
*/
- sqlite3VdbeChangeToNoop(v, (flags ? 3 : 4), 1);
- sqlite3VdbeChangeP2(v, (flags ? 4 : 3), pTab->tnum);
+ sqlite3VdbeChangeToNoop(v, (flags ? 2 : 3), 1);
+ sqlite3VdbeChangeP2(v, (flags ? 3 : 2), pTab->tnum);
+ sqlite3VdbeChangeP3(v, (flags ? 3 : 2), iDb);
/* Configure the OP_SetNumColumns. Configure the cursor to
** think that the table has one more column than it really
** we can invoke OP_Column to fill in the vdbe cursors type
** and offset cache without causing any IO.
*/
- sqlite3VdbeChangeP2(v, 5, pTab->nCol+1);
+ sqlite3VdbeChangeP2(v, 4, pTab->nCol+1);
if( !db->mallocFailed ){
sqlite3VdbeMakeReady(v, 1, 0, 1, 0);
}
** 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.268 2008/01/03 00:01:26 drh Exp $
+** $Id: where.c,v 1.269 2008/01/03 07:54:24 danielk1977 Exp $
*/
#include "sqliteInt.h"
if( (pIx = pLevel->pIdx)!=0 ){
KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx);
assert( pIx->pSchema==pTab->pSchema );
- sqlite3VdbeAddOp2(v, OP_Integer, iDb, 0);
- VdbeComment((v, "%s", pIx->zName));
- sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, 0,
+ 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);