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

Lowers the query blocks of the 5.x grammars.

Rule: MYSQL-BLOCK-LEGACY-001. Scope: select_part2, select_options_and_item_list, table_expression (5.7); select_into, select_from, opt_select_from (5.6); create_select, create_view_select, select_part2_derived, select_init2_derived, select_derived2, select_derived_init (both). A block written with its clauses inside one rule is lowered to the same query block as in 8.0 and later: the ORDER BY, LIMIT, PROCEDURE ANALYSE, trailing INTO and locking clauses stay open until the block is known to be the last operand of a union (MYSQL-UNION-LEGACY-001). Constructs: the query block. Terminates: every part is a strict subtree. Source: https://dev.mysql.com/doc/refman/5.7/en/select.html, https://dev.mysql.com/doc/refman/5.6/en/select.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function full(Form $form): Block

Lowers the 5.7 query block that writes a FROM clause.

Parameters

$formForm

Returns

Throws

ImplementationGap When a production has no rule
AnalysisException When PROCEDURE ANALYSE and INTO are both written (ER_WRONG_USAGE "PROCEDURE and INTO" of the 5.7 `select_part2` action, raised while parsing)
Called from 1
Calls 17
public function into(
    Node $clauses,
    list<SelectOption> $options,
    list<SelectExpression|Star|TableWildcard> $items,
    Trailer $lock,
): Block

Lowers the 5.6 clauses after the select list.

Parameters

$clausesNode
$optionslist<SelectOption>
$itemslist<SelectExpression|Star|TableWildcard>
$lockTrailer

Returns

Throws

ImplementationGap When a production has no rule
AnalysisException When PROCEDURE ANALYSE follows an INTO (ER_WRONG_USAGE "PROCEDURE and INTO" of the 5.6 `procedure_analyse_clause` action, which refuses a statement whose result is already set)
Called from 1
Calls 13
public function derived(Node $part, ?Node $expression = null): Block

Lowers the query block written directly after SELECT in a subquery or derived table of 5.x.

Parameters

$partNode
$expression?Node

Returns

Throws

ImplementationGap When a production has no rule
AnalysisException When the block writes PROCEDURE ANALYSE (ER_WRONG_USAGE "PROCEDURE and subquery" of the 5.6 `procedure_analyse_clause` action and of 5.7 `PT_procedure_analyse::contextualize`, raised while parsing)
Called from 6
Calls 12

Private surface 1§

Implementation details, listed for orientation only.

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 9
Method calls 12