final class DefinitionRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

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

$loweringLoweringThe lowering this rule belongs to
public function loadable(Node $tail): CreateLoadableFunction
public function alter(Form $form): AlterRoutine

Lowers ALTER PROCEDURE or ALTER FUNCTION: the form of a 5.x alter alternative, of alter_procedure_stmt or of alter_function_stmt.

Parameters

$formForm

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 6
public function drop(Form $form): DropProgram

Lowers 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

$formForm

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 6

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 $lowering

Test cases 4§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4

Relations§

Instantiated in 4
Method calls 4