1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-10-27 08:52:26 +03:00

Only evaluate expressions once for UPDATE and INSERT statements that

have BEFORE triggers.  Fix for ticket #980. (CVS 2158)

FossilOrigin-Name: 4852186aca3be6ea40069b6831079197e5fa757a
This commit is contained in:
drh
2004-12-07 15:41:48 +00:00
parent dca7684141
commit 2530378003
7 changed files with 127 additions and 18 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
** $Id: insert.c,v 1.127 2004/12/07 14:06:13 drh Exp $
** $Id: insert.c,v 1.128 2004/12/07 15:41:49 drh Exp $
*/
#include "sqliteInt.h"
@@ -523,7 +523,7 @@ void sqlite3Insert(
}else if( pSelect ){
sqlite3VdbeAddOp(v, OP_Dup, nColumn-j-1, 1);
}else{
sqlite3ExprCode(pParse, pList->a[j].pExpr);
sqlite3ExprCodeAndCache(pParse, pList->a[j].pExpr);
}
}
sqlite3VdbeAddOp(v, OP_MakeRecord, pTab->nCol, 0);