aboutsummaryrefslogtreecommitdiff
path: root/src/update.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-03-19 03:14:00 +0000
committerdrh <drh@noemail.net>2003-03-19 03:14:00 +0000
commit001bbcbb8fa5a55e9950445c6287a1fc0496e83e (patch)
tree0c8a0383e24add990c29dda08c96ad1f8585ccba /src/update.c
parent9468c7f489259174d8ec41b9db3adbdd87527b27 (diff)
downloadsqlite-001bbcbb8fa5a55e9950445c6287a1fc0496e83e.tar.gz
sqlite-001bbcbb8fa5a55e9950445c6287a1fc0496e83e.zip
Modifications to the VDBE to support more than one database file. (CVS 878)
FossilOrigin-Name: 875da9eed981bfa27b98e95025f9fdbed74b4098
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/update.c b/src/update.c
index fccd86343..c914e61ab 100644
--- a/src/update.c
+++ b/src/update.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.53 2003/01/13 23:27:33 drh Exp $
+** $Id: update.c,v 1.54 2003/03/19 03:14:02 drh Exp $
*/
#include "sqliteInt.h"
@@ -42,7 +42,6 @@ void sqliteUpdate(
int *aXRef = 0; /* aXRef[i] is the index in pChanges->a[] of the
** an expression for the i-th column of the table.
** aXRef[i]==-1 if the i-th column is not changed. */
- int openOp; /* Opcode used to open tables */
int chngRecno; /* True if the record number is being changed */
Expr *pRecnoExpr; /* Expression defining the new record number */
int openAll; /* True if all indices need to be opened */
@@ -232,7 +231,8 @@ void sqliteUpdate(
sqliteVdbeAddOp(v, OP_Dup, 0, 0);
sqliteVdbeAddOp(v, OP_Dup, 0, 0);
- sqliteVdbeAddOp(v, (pTab->isTemp?OP_OpenAux:OP_Open), base, pTab->tnum);
+ sqliteVdbeAddOp(v, OP_Integer, pTab->isTemp, 0);
+ sqliteVdbeAddOp(v, OP_OpenRead, base, pTab->tnum);
sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
sqliteVdbeAddOp(v, OP_Integer, 13, 0);
@@ -277,8 +277,8 @@ void sqliteUpdate(
** action, then we need to open all indices because we might need
** to be deleting some records.
*/
- openOp = pTab->isTemp ? OP_OpenWrAux : OP_OpenWrite;
- sqliteVdbeAddOp(v, openOp, base, pTab->tnum);
+ sqliteVdbeAddOp(v, OP_Integer, pTab->isTemp, 0);
+ sqliteVdbeAddOp(v, OP_OpenWrite, base, pTab->tnum);
if( onError==OE_Replace ){
openAll = 1;
}else{
@@ -292,7 +292,8 @@ void sqliteUpdate(
}
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){
if( openAll || aIdxUsed[i] ){
- sqliteVdbeAddOp(v, openOp, base+i+1, pIdx->tnum);
+ sqliteVdbeAddOp(v, OP_Integer, pTab->isTemp, 0);
+ sqliteVdbeAddOp(v, OP_OpenWrite, base+i+1, pIdx->tnum);
assert( pParse->nTab>base+i+1 );
}
}