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

Lowers BEGIN ... END blocks, their declarations and the cursor statements.

Rule: MYSQL-PROGRAM-BLOCK-LOWERING-001. Scope: sp_labeled_block, sp_unlabeled_block, sp_block_content, sp_decls, sp_decl, sp_decl_idents, sp_opt_default, sp_handler_type, sp_proc_stmt_open, sp_proc_stmt_fetch, sp_proc_stmt_close, sp_opt_fetch_noise, sp_fetch_list. The words NEXT FROM and FROM of FETCH hold no operand. Constructs: Block, VariableDeclaration, ConditionDeclaration, CursorDeclaration, HandlerDeclaration, OpenCursor, FetchCursor, CloseCursor. Terminates: every child is a strict subtree; lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/begin-end.html, https://dev.mysql.com/doc/refman/8.4/en/declare.html, https://dev.mysql.com/doc/refman/8.4/en/cursors.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function initial(Node $default): ?Scalar
public function cursor(Form $form): OpenCursor|FetchCursor|CloseCursor

Lowers OPEN, FETCH or CLOSE: the form of sp_proc_stmt_open, sp_proc_stmt_fetch or sp_proc_stmt_close.

Parameters

$formForm

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 8

Private surface 3§

Implementation details, listed for orientation only.

private const ACTIONS = ['sp_handler_type: EXIT_SYM' => \SqlSemantics\Platform\MySql\Statement\Routine\…
private const FETCH_WORDS = ['sp_opt_fetch_noise:' => true, 'sp_opt_fetch_noise: NEXT_SYM FROM' => true, 's…
private Lowering $lowering

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Method calls 2