classLateOrdering
final class LateOrdering
implements Node
uses Snapshot
@visibility public.An ORDER BY or LIMIT that a 5.6 subquery writes after the locking clauses of its query block, or a LIMIT it writes after the block's own LIMIT.
The 5.6 grammar lets a query specification of a subquery or a derived table be followed by opt_union_order_or_limit. Unless the block already orders or limits its rows, the server attaches that ORDER BY and LIMIT to the block itself (the order_clause action adds no query level, and limit_options sets the limit of the current block), so they are the block's own clauses written at a later position; a LIMIT written after a LIMIT of the block replaces it. The block that holds the clauses derives them like its own ORDER BY and LIMIT. Source: https://dev.mysql.com/doc/refman/5.6/en/select.html, https://github.com/mysql/mysql-server/blob/mysql-5.6.51/sql/sql_yacc.yy (order_clause, limit_options).
$query = (new \SqlSemantics\Platform\MySql\Semantics('mysql-5.6.51'))->analyze('SELECT (SELECT a FROM t FOR UPDATE ORDER BY a)');
count($query->statement->items[0]->expression->query->late->orderBy) // => 1new \SqlSemantics\Platform\MySql\Statement\Query\Clause\LateOrdering([]) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstructionProperties§
public list<OrderItem> $orderBypublic Limit|null $limit = nullMethods§
Calls 5
- static-call Check::listOf() line 51
- class-const OrderItem::class() line 51
- method-call SortScopes::check() line 52
- new SortScopes line 52
- static-call Check::input() line 53
public function render(Output $out): voidWrites ORDER BY and LIMIT.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 62
- method-call Output::node() line 64
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.