1
0
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:
dan
2009-09-09 15:06:10 +00:00
parent c4c307a963
commit ae0931edae
5 changed files with 112 additions and 23 deletions

View File

@@ -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 ){