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

Lowers the keyword constructs of simple_expr: CASE, CAST, CONVERT, BINARY and MATCH … AGAINST.

Rule: MYSQL-CONSTRUCT-001. Scope: the simple_expr productions of these constructs and opt_expr, when_list, opt_else, opt_array_cast, opt_interval, ident_list_arg, ident_list, fulltext_options, opt_natural_language_mode, opt_query_expansion. CONVERT(expr, type) is a CAST; the parentheses around the MATCH columns and the words IN NATURAL LANGUAGE MODE are not part of the structure. The WHEN branches are flattened along their list spine. Constructs: CaseExpression, CaseBranch, Cast, CastAtLocal, AtTimeZone, CharsetConversion, BinaryCast, FullTextSearch. Terminates: list spines are flattened in a loop; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/flow-control-functions.html, https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html, https://dev.mysql.com/doc/refman/8.4/en/fulltext-search.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function optional(Node $optional): ?Scalar

Lowers the optional operand of CASE or its ELSE result: a node of opt_expr or opt_else.

Parameters

$optionalNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function branches(Node $list): list<CaseBranch>
public function search(Form $form): FullTextSearch

Lowers MATCH ... AGAINST, keeping whether the column list is parenthesized and whether IN NATURAL LANGUAGE MODE is written.

Parameters

$formForm

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 7
public function columns(Node $argument): list<ColumnUse>

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

Test cases 8§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 8

Relations§

Instantiated in 1
Method calls 1