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

Lowers the table references and joins of the 5.x grammars.

Rule: MYSQL-JOIN-LEGACY-001. Scope: join_table_list, derived_table_list, esc_table_ref, table_ref, join_table, normal_join, opt_outer (5.x). The joins follow the parse, which nests conditionless joins to the left; a join on the left is walked in a loop. JOIN, INNER JOIN, CROSS JOIN and STRAIGHT_JOIN are kept as written, and so is OUTER. Constructs: JoinedTable, EscapedRelation. Terminates: the list and the left spine are walked in loops; recursion follows the strictly smaller right operands. Source: https://dev.mysql.com/doc/refman/5.7/en/join.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function escaped(Node $reference): Relation

Lowers a reference with its optional ODBC escape.

Parameters

$referenceNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 4
public function joined(Node $joined): JoinedTable

Lowers a join, walking the joins on its left in a loop.

Parameters

$joinedNode

Throws

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

Private surface 3§

Implementation details, listed for orientation only.

private const array<string, array{JoinOperator|null, int, int|null, int|null}> JOINS = ['join_table: table_ref normal_join table_ref' => [null, 2, null, null], 'join_…
private const NORMAL = ['normal_join: JOIN_SYM' => \SqlSemantics\Platform\MySql\Statement\Relation\Joi…
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 2
Method calls 2