classDefinitionRule
final class DefinitionRule
Lowers CREATE, ALTER and DROP of stored procedures and functions, CREATE of loadable functions, and DROP of triggers and events.
Rule: MYSQL-ROUTINE-DEFINITION-LOWERING-001. Scope: sp_tail, sf_tail, udf_tail, udf_type, alter_procedure_stmt, alter_function_stmt, drop_procedure_stmt, drop_function_stmt, drop_trigger_stmt, drop_event_stmt, and the alter and drop alternatives of these objects (5.6, 5.7). The symbols of a tail are read by rule name, so one reading serves the layouts of every release. Constructs: CreateProcedure, CreateFunction, CreateLoadableFunction, AlterRoutine, DropProgram. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/create-procedure.html, https://dev.mysql.com/doc/refman/8.4/en/create-function-loadable.html, https://dev.mysql.com/doc/refman/8.4/en/alter-procedure.html, https://dev.mysql.com/doc/refman/8.4/en/drop-procedure.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function routine(Node $tail, ?Account $definer): CreateProcedure|CreateFunctionLowers CREATE PROCEDURE or CREATE FUNCTION of a stored function: a node of sp_tail or sf_tail, and the definer.
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 12
- method-call Lowering::form() line 109
- class-const DefinitionRule::ROUTINES() line 110
- static-call ImplementationGap::production() line 111
- method-call CharacteristicRule::characteristics() line 124
- new CharacteristicRule line 124
- method-call StatementRule::body() line 125
- new StatementRule line 125
- new CreateProcedure line 127
- method-call ParameterRule::parameters() line 127
- new ParameterRule line 127
- method-call ParameterRule::declared() line 129
- new CreateFunction line 131
public function loadable(Node $tail): CreateLoadableFunctionLowers CREATE FUNCTION of a loadable function: a node of udf_tail.
Parameters
$tail | Node |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 6
- method-call Lowering::form() line 141
- class-const DefinitionRule::LOADABLE() line 142
- static-call ImplementationGap::production() line 142
- function-call
countline 143 - new CreateLoadableFunction line 155
- class-const DefinitionRule::RESULTS() line 157
public function alter(Form $form): AlterRoutineLowers ALTER PROCEDURE or ALTER FUNCTION: the form of a 5.x alter alternative, of
alter_procedure_stmt or of alter_function_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 6
- class-const DefinitionRule::ALTERS() line 172
- static-call ImplementationGap::production() line 172
- new AlterRoutine line 174
- method-call Form::node() line 174
- method-call CharacteristicRule::characteristics() line 174
- new CharacteristicRule line 174
public function drop(Form $form): DropProgramLowers DROP of a procedure, function, trigger or event: the form of a 5.x drop alternative or of
one of the drop_*_stmt rules.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When a production has no ruleTest cases 1
Called from 1
Calls 6
- class-const DefinitionRule::DROPS() line 185
- new DropProgram line 186
- method-call Form::node() line 186
- new QualifiedName line 189
- static-call ImplementationGap::production() line 191
- class-const ProgramKind::Function() line 194
Private surface 6§
Implementation details, listed for orientation only.
private const ROUTINES = ['sp_tail: PROCEDURE_SYM remember_name sp_name ( sp_pdparam_list ) sp_c_chistic…private const LOADABLE = ['udf_tail: AGGREGATE_SYM remember_name FUNCTION_SYM ident RETURNS_SYM udf_type…private const RESULTS = ['udf_type: STRING_SYM' => \SqlSemantics\Platform\MySql\Statement\Routine\Loada…private const ALTERS = ['alter: ALTER PROCEDURE_SYM sp_name sp_a_chistics' => \SqlSemantics\Platform\M…private const DROPS = ['drop: DROP PROCEDURE_SYM if_exists sp_name' => \SqlSemantics\Platform\MySql\S…private Lowering $loweringTest cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::definition() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:69
- new SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::definition() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:70
- new SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::create() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:84
- new SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::create() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:85
Method calls 4
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::definition() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:69
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::definition() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:70
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::create() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:84
- method-call SqlSemantics\Platform\MySql\Lowering\Routine\RoutineRules::create() packages/sql-semantics-mysql/src/Lowering/Routine/RoutineRules.php:85