classGetDiagnostics
final class GetDiagnostics
implements Statement, ProgramStatement
uses Snapshot
Public API: explicitly declared with
@visibility public.GET DIAGNOSTICS: copies statement or condition information of a diagnostics area into variables.
The statement is valid on its own and inside a stored program; it returns no rows. The facts follow MYSQL-PROGRAM-CONDITIONS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/get-diagnostics.html.
$get = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('GET STACKED DIAGNOSTICS CONDITION 1 @m = MESSAGE_TEXT');
[$get->statement->area->value, $get->toString()] // => ['STACKED', 'GET STACKED DIAGNOSTICS CONDITION 1 @m = MESSAGE_TEXT']Properties§
public ConditionDiagnostics|StatementDiagnostics $informationpublic DiagnosticsArea|null $area = nullMethods§
public function __construct(
public ConditionDiagnostics|StatementDiagnostics $information,
public DiagnosticsArea|null $area = null,
)Parameters
$information | ConditionDiagnostics|StatementDiagnostics | The information read |
$area | DiagnosticsArea|null | The area keyword, when written |
public function deriveStatement(Derivation $derivation): voidDerives the statement outside a stored program, where no local variable is in scope.
Parameters
$derivation | Derivation |
Calls 3
- method-call GetDiagnostics::deriveProgram() line 44
- new ProgramScope line 44
- method-call Derivation::environment() line 44
public function deriveProgram(Derivation $derivation, ProgramScope $scope): voidDerives the condition number and the targets in the scope of the statement.
Parameters
$derivation | Derivation | |
$scope | ProgramScope |
Called from 1
Calls 3
- method-call Derivation::scalar() line 53
- method-call ConditionFacts::targets() line 55
- new ConditionFacts line 55
public function render(Output $out): voidTest cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
GetDiagnosticsTest::testDeriveProgramResolvesParametersAndLocalVariablescallsGetDiagnosticsTest::testDeriveStatementReadsConditionInformationOfAVariableNumbercallsGetDiagnosticsTest::testDeriveStatementReadsStatementInformationIntoUserVariablescallsGetDiagnosticsTest::testRenderWritesTheStatementcalls
Other tests reaching this symbol 10
DiagnosticsRuleTest::testItemsLowersEveryConditionItemNamecallsDiagnosticsRuleTest::testItemsLowersLocalVariableTargetscallsDiagnosticsRuleTest::testStatementLowersConditionInformationcallsDiagnosticsRuleTest::testStatementLowersStatementInformationcallsDiagnosticsRuleTest::testStatementLowersTheAreacallsDiagnosticsRuleTest::testStatementLowersTheConditionNumberAsAVariablecallsRoutineRulesTest::testStatementLowersSignalResignalAndGetDiagnosticscallsConditionDiagnosticsTest::testRenderWritesTheAnalyzedInformationcallsInformationItemTest::testRenderWritesTheTargetsOfAStatementcallsStatementDiagnosticsTest::testRenderWritesTheAnalyzedInformationcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\Routine\Condition\DiagnosticsRule::statement() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/DiagnosticsRule.php:93
- new SqlSemantics\Platform\MySql\Lowering\Routine\Condition\DiagnosticsRule::statement() packages/sql-semantics-mysql/src/Lowering/Routine/Condition/DiagnosticsRule.php:103