1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Support for temporary tables added. Still need more testing. (CVS 279)

FossilOrigin-Name: 9368c62e4097aae3081a325962c1dec167fd253d
This commit is contained in:
drh
2001-10-08 13:22:32 +00:00
parent 382c0247c7
commit f57b339988
18 changed files with 684 additions and 311 deletions

View File

@@ -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.16 2001/09/27 03:22:34 drh Exp $
** $Id: update.c,v 1.17 2001/10/08 13:22:33 drh Exp $
*/
#include "sqliteInt.h"
@@ -39,6 +39,7 @@ 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 */
if( pParse->nErr || sqlite_malloc_failed ) goto update_cleanup;
db = pParse->db;
@@ -159,9 +160,10 @@ void sqliteUpdate(
*/
sqliteVdbeAddOp(v, OP_ListRewind, 0, 0, 0, 0);
base = pParse->nTab;
sqliteVdbeAddOp(v, OP_OpenWrite, base, pTab->tnum, 0, 0);
openOp = pTab->isTemp ? OP_OpenWrAux : OP_OpenWrite;
sqliteVdbeAddOp(v, openOp, base, pTab->tnum, 0, 0);
for(i=0; i<nIdx; i++){
sqliteVdbeAddOp(v, OP_OpenWrite, base+i+1, apIdx[i]->tnum, 0, 0);
sqliteVdbeAddOp(v, openOp, base+i+1, apIdx[i]->tnum, 0, 0);
}
/* Loop over every record that needs updating. We have to load