final class Signal
    implements Statement, ProgramStatement
    uses Snapshot
Public API: explicitly declared with @visibility public.

SIGNAL: raises a condition.

The statement is valid on its own and inside a stored program, where a condition name and the names in the item values are resolved in the scope of the statement. The facts follow MYSQL-PROGRAM-CONDITIONS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/signal.html.

Reading the statementdoctest
$signal = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SIGNAL SQLSTATE VALUE '45000' SET MESSAGE_TEXT = 'no'");
    [$signal->statement->condition->state->value, $signal->toString()] // => ['45000', "SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'no'"]

Properties§

public list<SignalItem> $items

Methods§

public function __construct(
    public ConditionName|SqlState $condition,
    list<SignalItem> $items = [],
)

Parameters

$conditionConditionName|SqlStateThe condition raised: an SQLSTATE value or a condition name
$itemslist<SignalItem>The condition information items of the SET clause; empty without SET
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the statement outside a stored program, where no condition name and no local variable is in scope.

Parameters

$derivationDerivation
Calls 3
public function deriveProgram(Derivation $derivation, ProgramScope $scope): void
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 1

Test cases 14§

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

Dedicated tests 3
Other tests reaching this symbol 11

Relations§

Instantiated in 1
Type declarations 1