classAlterRoutine
final class AlterRoutine
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER PROCEDURE or ALTER FUNCTION: changes the characteristics of a stored routine.
Rule: MYSQL-ALTER-ROUTINE-001. The statement is structured as a request only: it changes no context and derives nothing. The parameters and the body of a routine cannot be altered, and DETERMINISTIC is no characteristic of ALTER. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-procedure.html, https://dev.mysql.com/doc/refman/8.4/en/alter-function.html. Status: Implemented.
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER FUNCTION shop.f NO SQL');
[$alter->statement->kind, count($alter->statement->characteristics)] // => [\SqlSemantics\Platform\MySql\Statement\Routine\ProgramKind::Function, 1]Properties§
public list<Characteristic> $characteristicspublic ProgramKind $kindpublic QualifiedName $nameMethods§
public function __construct(
public ProgramKind $kind,
public QualifiedName $name,
list<Characteristic> $characteristics = [],
)Parameters
$kind | ProgramKind | Whether a procedure or a function is altered |
$name | QualifiedName | The routine name with its optional database |
$characteristics | list<Characteristic> | The new characteristics; may be empty |
Calls 5
- static-call Check::input() line 49
- class-const ProgramKind::Procedure() line 49
- class-const ProgramKind::Function() line 49
- static-call Check::listOf() line 51
- class-const Characteristic::class() line 51
public function deriveStatement(Derivation $derivation): voidDerives nothing: altering a routine is a request.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Test cases 1
Calls 4
- method-call Output::keyword() line 69
- method-call ProgramNames::qualified() line 70
- new ProgramNames line 70
- method-call Output::node() line 72
Test cases 14§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
AlterRoutineTest::testADeterministicCharacteristicIsRejectedcallsAlterRoutineTest::testANameWithACatalogIsRejectedcallsAlterRoutineTest::testAnEventIsRejectedcallsAlterRoutineTest::testATriggerIsRejectedcallsAlterRoutineTest::testDeriveStatementReadsTheKindTheNameAndTheCharacteristicscallsAlterRoutineTest::testRenderWritesAConstructedAlterationcalls
Other tests reaching this symbol 8
CharacteristicRuleTest::testCharacteristicLowersTheSecurityContextcallsCharacteristicRuleTest::testCharacteristicsKeepTheWrittenOrderOfAnAltercallsDefinitionRuleTest::testAlterLowersProceduresAndFunctionscallsRoutineRulesTest::testStatementLowersSignalResignalAndGetDiagnosticscallsDataAccessTest::testRenderWritesTheKeywordsOfTheLevelcallsRoutineCommentTest::testRenderWritesTheCommentTextcallsRoutineLanguageTest::testRenderWritesTheKeywordSqlcallsSqlSecurityTest::testRenderWritesTheContextKeywordcalls