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

Lowers the clauses written after a query: LIMIT, PROCEDURE ANALYSE, INTO and the locking clauses.

Rule: MYSQL-QUERY-TAIL-001. Scope: opt_limit_clause, opt_limit_clause_init, limit_clause, limit_options, limit_option, opt_simple_limit, procedure_analyse_clause, opt_procedure_analyse_clause, opt_procedure_analyse_params, procedure_analyse_param, into, into_clause, opt_into, into_destination, select_var_list_init, select_var_list, select_var_ident, select_lock_type, opt_select_lock_type, locking_clause_list, locking_clause, lock_strength, table_locking_list, opt_locked_row_action, locked_row_action. A LIMIT operand is an unsigned integer, a parameter marker or a stored program variable; an INTO target written with @ is a user variable, a bare one a stored program variable. Constructs: RowLimit, ProcedureAnalyse, IntoVariables, IntoOutfile, IntoDumpfile, ProgramVariable, LockingClause. Terminates: lists are flattened iteratively. Source: https://dev.mysql.com/doc/refman/8.4/en/select.html, https://dev.mysql.com/doc/refman/8.4/en/select-into.html, https://dev.mysql.com/doc/refman/8.4/en/innodb-locking-reads.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function limit(Node $clause): ?RowLimit

Lowers a LIMIT clause; an absent clause is null.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 12
Calls 6
public function options(Node $options): RowLimit
public function into(Node $clause): ?IntoDestination

Lowers an INTO clause; an absent clause is null.

Parameters

$clauseNode

Throws

ImplementationGap When a production has no rule
Called from 11
Calls 4
public function variables(Node $list): IntoVariables
public function locking(Node $clause): list<LockingClause>

Lowers the locking clause of the 5.x grammars or the locking clause list of 8.0 and later; an absent clause is empty.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 11
Calls 8
public function lock(Node $clause): LockingClause

Lowers one locking clause of 8.0 and later.

Parameters

$clauseNode

Throws

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

Private surface 3§

Implementation details, listed for orientation only.

private const ACTIONS = ['opt_locked_row_action:' => null, 'locked_row_action: SKIP_SYM LOCKED_SYM' => …
private const LEGACY_LOCKS = ['select_lock_type:' => null, 'opt_select_lock_type:' => null, 'select_lock_typ…
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 16
Method calls 36