1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Add the sqlite3_preupdate_new() API, for retrieving the new.* values from within a pre-update callback.

FossilOrigin-Name: 526545c49f64d9063d1b888cfc14ece62fa3c13c
This commit is contained in:
dan
2011-03-16 19:59:18 +00:00
parent 6566ebe1b6
commit 37db03bf73
11 changed files with 196 additions and 71 deletions

View File

@@ -493,7 +493,13 @@ void sqlite3Update(
/* If changing the rowid value, or if there are foreign key constraints
** to process, delete the old record. Otherwise, add a noop OP_Delete
** to invoke the pre-update hook.
**
** That (regNew==regnewRowid+1) is true is also important for the
** pre-update hook. If hte caller invokes preupdate_new(), the returned
** value is copied from memory cell (regNewRowid+1+iCol), where iCol
** is the column index supplied by the user.
*/
assert( regNew==regNewRowid+1 );
sqlite3VdbeAddOp3(v, OP_Delete, iCur,
OPFLAG_ISUPDATE | ((hasFK || chngRowid) ? 0 : OPFLAG_ISNOOP),
regNewRowid