classTailRule
final class TailRule
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
$lowering | Lowering | The lowering this rule belongs to |
Lowers a LIMIT clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 12
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:136
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:174
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:176
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:223
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\UnionRule::ordering() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/UnionRule.php:160
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\UnionRule::ordering() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/UnionRule.php:161
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:117
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limit() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:175
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::limit() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:81
Calls 6
- method-call Lowering::form() line 77
- method-call TailRule::limit() line 81
- method-call TailRule::options() line 82
- new RowLimit line 83
- method-call TailRule::value() line 83
- static-call ImplementationGap::production() line 84
Lowers the operands of a LIMIT clause.
Parameters
$options | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 95
- new RowLimit line 98
- method-call TailRule::value() line 98
- class-const OffsetSpelling::Comma() line 99
- class-const OffsetSpelling::Keyword() line 100
- static-call ImplementationGap::production() line 101
Lowers one LIMIT operand.
Parameters
$option | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 5
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limitValue() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:185
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::limit() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:83
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::options() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::options() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:99
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::options() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:100
Calls 4
- method-call Lowering::form() line 112
- new ProgramVariable line 115
- new NumberLiteral line 117
- static-call ImplementationGap::production() line 118
public function procedure(Node $clause): ?ProcedureAnalyseLowers a PROCEDURE ANALYSE clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:87
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:174
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
Calls 4
- method-call Lowering::form() line 129
- static-call ImplementationGap::production() line 134
- new NumberLiteral line 149
- new ProcedureAnalyse line 152
public function into(Node $clause): ?IntoDestinationLowers an INTO clause; an absent clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 11
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:66
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:85
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:137
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:139
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:140
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:93
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:166
Calls 4
- method-call Lowering::form() line 162
- method-call TailRule::into() line 166
- method-call TailRule::destination() line 167
- static-call ImplementationGap::production() line 168
public function destination(Node $destination): IntoDestinationLowers the destination of an INTO clause.
Parameters
$destination | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:167
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Shared\TailRule::destination() packages/sql-semantics-mysql/src/Lowering/Query/Shared/TailRule.php:184
Calls 6
- method-call Lowering::form() line 179
- new IntoOutfile line 182
- new IntoDumpfile line 183
- method-call TailRule::destination() line 184
- method-call TailRule::variables() line 185
- static-call ImplementationGap::production() line 186
public function variables(Node $list): IntoVariablesLowers the variables of an INTO clause in written order.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 6
- method-call Lowering::form() line 197
- static-call ImplementationGap::production() line 199
- method-call Lists::items() line 202
- new Lists line 202
- new ProgramVariable line 206
- new IntoVariables line 211
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
$clause | Node |
Returns
list<LockingClause>Throws
ImplementationGap When a production has no ruleCalled from 11
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:58
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:66
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:224
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::derived() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:260
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::statement() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:78
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::locked() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:211
Calls 8
- method-call Lowering::form() line 222
- function-call
array_key_existsline 223 - class-const TailRule::LEGACY_LOCKS() line 223
- new LockingClause line 226
- static-call ImplementationGap::production() line 229
- method-call Lists::items() line 232
- new Lists line 232
- method-call TailRule::lock() line 233
public function lock(Node $clause): LockingClauseLowers one locking clause of 8.0 and later.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 9
- method-call Lowering::form() line 246
- new LockingClause line 248
- class-const LockStrength::ShareMode() line 248
- static-call ImplementationGap::production() line 255
- function-call
countline 263 - function-call
array_key_existsline 267 - class-const TailRule::ACTIONS() line 267
- class-const LockStrength::Update() line 272
- class-const LockStrength::Share() line 273
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 $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TailRuleTestcalls
Relations§
Instantiated in 16
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:54
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:84
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:134
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:161
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:195
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:223
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:224
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::derived() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:260
- new SqlSemantics\Platform\MySql\Lowering\Query\Legacy\UnionRule::ordering() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/UnionRule.php:155
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::statement() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:74
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:92
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:117
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::locked() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:211
- new SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:93
- new SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limit() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:175
- new SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limitValue() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:185
Method calls 36
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:58
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:66
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::part() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:66
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:85
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:86
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:87
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::full() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:136
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:137
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:139
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:140
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:174
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:174
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::from() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:176
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:207
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:223
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::optional() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:224
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\BlockRule::derived() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/BlockRule.php:260
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\UnionRule::ordering() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/UnionRule.php:160
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Legacy\UnionRule::ordering() packages/sql-semantics-mysql/src/Lowering/Query/Legacy/UnionRule.php:161
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::statement() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:78
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:97
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::into() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:98
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::expression() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:117
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\ExpressionRule::locked() packages/sql-semantics-mysql/src/Lowering/Query/Modern/ExpressionRule.php:211
- method-call SqlSemantics\Platform\MySql\Lowering\Query\Modern\PrimaryRule::specification() packages/sql-semantics-mysql/src/Lowering/Query/Modern/PrimaryRule.php:93
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limit() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:175
- method-call SqlSemantics\Platform\MySql\Lowering\Query\QueryRules::limitValue() packages/sql-semantics-mysql/src/Lowering/Query/QueryRules.php:185