final class TriggerAssignments
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Checks the assignments of SET to a column of the NEW or OLD row in a trigger body.

Rule: MYSQL-TRIGGER-ASSIGNMENT-001. In a trigger, a SET item without a scope keyword whose name is qualified by NEW or OLD, in any letter case, assigns to a column of the row of the trigger table. The OLD row cannot be changed (ER_TRG_CANT_CHANGE_ROW); a DELETE trigger has no NEW row (ER_TRG_NO_SUCH_ROW_IN_TRG); an AFTER trigger cannot change the NEW row (ER_TRG_CANT_CHANGE_ROW). Otherwise the name is resolved as a column of the NEW row, and a column the table does not have is reported (ER_BAD_FIELD_ERROR); a table that is not completely known reports nothing. The value is derived by the SET statement itself at the position of the body, where NEW and OLD are visible. Terminates: one pass over the items. Source: https://dev.mysql.com/doc/refman/8.4/en/trigger-syntax.html ("In a BEFORE trigger, you can also change its value with SET NEW.col_name

  • = value"; "OLD columns are read only").

Status: Implemented.

Methods§

public function check(
    SetVariables $set,
    TriggerTime $time,
    TriggerEvent $event,
    Derivation $derivation,
    ProgramScope $scope,
): void

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Method calls 1