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

Derives condition values, SIGNAL and RESIGNAL, and the targets of GET DIAGNOSTICS.

Rule: MYSQL-PROGRAM-CONDITIONS-001. An SQLSTATE value is five digits or upper-case letters and does not begin with 00, which means success (ER_SP_BAD_SQLSTATE); an error code is not 0 (ER_WRONG_VALUE). Two condition values are the same when they are the same general condition, the same error number or the same SQLSTATE value; a condition name stands for the value it is declared for. A condition name must be declared around the statement (ER_SP_COND_MISMATCH); SIGNAL and RESIGNAL accept only a name declared for an SQLSTATE value (ER_SIGNAL_BAD_CONDITION_TYPE). Each condition information item is set at most once (ER_DUP_SIGNAL_SET); its value is derived in the scope of the statement, where a name is a parameter or local variable. A target of GET DIAGNOSTICS is a user variable or a parameter or local variable in scope (ER_SP_UNDECLARED_VAR). Terminates: the lists are finite. Source: https://dev.mysql.com/doc/refman/8.4/en/declare-condition.html, https://dev.mysql.com/doc/refman/8.4/en/signal.html, https://dev.mysql.com/doc/refman/8.4/en/get-diagnostics.html. Status: Implemented.

Methods§

public function meaning(Condition $value, ProgramScope $scope): ?Condition

Answers the value a condition stands for: the declared value of a condition name, null for an undeclared name.

Parameters

Returns

Test cases 1
Called from 1
Calls 1
public function same(Condition $left, Condition $right): bool

Tells whether two condition values, names already replaced by their meaning, are the same.

Parameters

Returns

bool
Test cases 1
Called from 1
Calls 1

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 5
Method calls 7