classConditionDeclaration
final class ConditionDeclaration
implements Declaration
uses Snapshot
Public API: explicitly declared with
@visibility public.DECLARE ... CONDITION: a name for an error code or an SQLSTATE value.
Source: https://dev.mysql.com/doc/refman/8.4/en/declare-condition.html.
$create = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("CREATE PROCEDURE p() BEGIN DECLARE gone CONDITION FOR SQLSTATE '42S02'; END");
$declaration = $create->statement->body->declarations[0];
[$declaration->name->value, $declaration->value->state->value] // => ['gone', '42S02']Properties§
public Name $nameMethods§
public function render(Output $out): voidWrites the declaration.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 42
- class-const NameUse::Identifier() line 42
Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 9
ConditionRuleTest::testValueLowersAnErrorCodeAndAnSqlstatecallsBlockRuleTest::testDeclarationLowersAConditionAndAHandlercallsConditionFactsTest::testMeaningAnswersTheDeclaredValueOfAConditionNamecallsProgramScopeTest::testConditionFindsTheInnermostDeclarationOfTheNamecallsProgramScopeTest::testDeclaredReplacesTheEnvironmentConditionsAndCursorscallsProgramScopeTest::testHandlerSeesNoLabelOutsideTheHandlercallsErrorCodeTest::testRenderWritesTheCodesOfADeclarationAndAHandlercallsDeclarationTest::providerImplementationsAreTheFourDeclarationscallsProgramStatementTest::providerDeriveProgramIsImplementedByTheProgramStatementClassescalls