1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

Add testcase() macros to make sure boundary cases in BEFORE UPDATE triggers

are well tested.

FossilOrigin-Name: 27175caa28919fe145d369f27f52346b8bbadb1e
This commit is contained in:
drh
2009-12-01 22:09:25 +00:00
parent d8267b8925
commit fd7c9912b4
3 changed files with 13 additions and 11 deletions

View File

@@ -119,7 +119,7 @@ void sqlite3Update(
Trigger *pTrigger; /* List of triggers on pTab, if required */
int tmask; /* Mask of TRIGGER_BEFORE|TRIGGER_AFTER */
#endif
int newmask;
int newmask; /* Mask of NEW.* columns accessed by BEFORE triggers */
/* Register Allocations */
int regRowCount = 0; /* A count of rows changed */
@@ -436,6 +436,8 @@ void sqlite3Update(
** if there are one or more BEFORE triggers that use this value via
** a new.* reference in a trigger program.
*/
testcase( i==31 );
testcase( i==32 );
sqlite3VdbeAddOp3(v, OP_Column, iCur, i, regNew+i);
sqlite3ColumnDefault(v, pTab, i, regNew+i);
}