classConditionRule
final class ConditionRule
Lowers condition values: error codes, SQLSTATE values, condition names and condition classes.
Rule: MYSQL-CONDITION-LOWERING-001. Scope: sp_cond, sqlstate, opt_value, sp_hcond, sp_hcond_element, sp_hcond_list. The optional word VALUE holds no operand. Constructs: ErrorCode, SqlState, ConditionName, GeneralCondition. Terminates: the list is flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/declare-condition.html, https://dev.mysql.com/doc/refman/8.4/en/declare-handler.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Lowers an error code or an SQLSTATE value: a node of sp_cond or sqlstate.
Parameters
$condition | Node |
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Condition\ConditionRule::handled() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/ConditionRule.php:84
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Condition\SignalRule::condition() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/SignalRule.php:95
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:107
Calls 4
- method-call Lowering::form() line 47
- new ErrorCode line 52
- static-call ImplementationGap::production() line 55
- new SqlState line 62
Lowers the conditions of a handler: a node of sp_hcond_list.
Parameters
$list | Node |
Returns
list<Condition>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 10
- method-call Sequence::items() line 74
- new Sequence line 74
- method-call Lowering::form() line 75
- static-call ImplementationGap::production() line 77
- method-call ConditionRule::value() line 84
- new ConditionName line 85
- new GeneralCondition line 86
- class-const ConditionClass::SqlWarning() line 86
- class-const ConditionClass::NotFound() line 87
- class-const ConditionClass::SqlException() line 88
Private surface 1§
Implementation details, listed for orientation only.
private Lowering $loweringTest 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 3
- new SqlSemantics\Platform\MySql\Lowering\Routine\Condition\SignalRule::condition() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/SignalRule.php:95
- new SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:107
- new SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:113
Method calls 3
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Condition\SignalRule::condition() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/SignalRule.php:95
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:107
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\Program\BlockRule::declaration() packages/sql-semantics-mysql/src/Lowering/Routine/Program/BlockRule.php:113