diff options
author | danielk1977 <danielk1977@noemail.net> | 2008-01-03 07:54:23 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2008-01-03 07:54:23 +0000 |
commit | 207872a48882bab0cb653e8e1b2510cba61bf1c8 (patch) | |
tree | 49e9c8623940238a5b469d281413dd4a3154d7e1 /src/vdbeblob.c | |
parent | 0d78bae377957221773e982ab023ecff924dfd4a (diff) | |
download | sqlite-207872a48882bab0cb653e8e1b2510cba61bf1c8.tar.gz sqlite-207872a48882bab0cb653e8e1b2510cba61bf1c8.zip |
Change OP_OpenRead and OP_OpenWrite so that the database number is read from the P3 operand, not the stack. (CVS 4663)
FossilOrigin-Name: 35da261daf602b1e938f05bbad1ff99213d9f4b9
Diffstat (limited to 'src/vdbeblob.c')
-rw-r--r-- | src/vdbeblob.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/vdbeblob.c b/src/vdbeblob.c index d56fbd127..864aadd9b 100644 --- a/src/vdbeblob.c +++ b/src/vdbeblob.c @@ -12,7 +12,7 @@ ** ** 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" @@ -66,21 +66,20 @@ int sqlite3_blob_open( 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; @@ -166,14 +165,12 @@ int sqlite3_blob_open( /* 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 @@ -182,7 +179,7 @@ int sqlite3_blob_open( ** 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); } |