mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-06 15:49:35 +03:00
Add some tests that involve BEFORE UPDATE or BEFORE DELETE triggers messing with the row being updated or deleted. SQLite behaviour in this scenario is undefined, so the tests just check that the behaviour is relatively sane and there are no crashes.
FossilOrigin-Name: 9a4c59a2ddd0df2d9425097004b450a6685f2147
This commit is contained in:
@@ -428,6 +428,13 @@ void sqlite3Update(
|
||||
sqlite3TableAffinityStr(v, pTab);
|
||||
sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges,
|
||||
TRIGGER_BEFORE, pTab, -1, regOldRowid, onError, addr);
|
||||
|
||||
/* The row-trigger may have deleted the row being updated. In this
|
||||
** case, jump to the next row. No updates or AFTER triggers are
|
||||
** required. This behaviour - what happens when the row being updated
|
||||
** is deleted or renamed by a BEFORE trigger - is left undefined in the
|
||||
** documentation. */
|
||||
sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addr, regOldRowid);
|
||||
}
|
||||
|
||||
if( !isView ){
|
||||
|
||||
Reference in New Issue
Block a user