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

Lowers WEIGHT_STRING with its cast, its LEVEL clause of MySQL 5.6 and 5.7, and its internal form.

Rule: MYSQL-CALL-WEIGHT-001. Scope: the WEIGHT_STRING alternatives of function_call_conflict, ws_nweights, ws_num_codepoints, opt_ws_levels, ws_level_list_or_range, ws_level_list, ws_level_list_item, ws_level_range, ws_level_number, ws_level_flags, ws_level_flag_desc, ws_level_flag_reverse. Constructs: WeightString, WeightStringParameters, WeightLevel, WeightLevelRange. Terminates: the level list is flattened in a loop; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_weight-string, https://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_weight-string. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function claims(string $signature): bool

Tells whether a production is one of this rule.

Parameters

$signaturestring

Returns

bool
Test cases 1
Called from 1
Calls 2
public function length(Node $length): Numeral

Lowers the length of the cast: a node of ws_nweights or ws_num_codepoints.

Parameters

$lengthNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function level(Node $item): WeightLevel

Lowers one level with its flags: a node of ws_level_list_item.

Parameters

$itemNode

Throws

ImplementationGap When a production has no rule
Test cases 1
Called from 1
Calls 7
public function direction(Node $flag): Direction

Lowers the ASC or DESC flag of a level: a node of ws_level_flag_desc.

Parameters

$flagNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 4

Private surface 3§

Implementation details, listed for orientation only.

private const CASTS = ['function_call_conflict: WEIGHT_STRING_SYM ( expr AS CHAR_SYM ws_nweights opt_…
private const FLAGS = ['ws_level_flags:' => [null, false], 'ws_level_flags: ws_level_flag_desc' => [t…
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 2