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

Lowers character set and collation names.

Rule: MYSQL-CHARSET-NAME-001. Scope: charset_name, charset_name_or_default, old_or_new_charset_name, old_or_new_charset_name_or_default, default_charset, collation_name, collation_name_or_default, opt_collate, opt_collate_explicit, default_collation. A name is an identifier or a string; the keyword BINARY at such a position is the name binary; the keyword DEFAULT is the absence of a name. The optional DEFAULT before CHARACTER SET or COLLATE and the optional equals sign of a table or database option are not kept. Constructs: Name, CharsetName, CollationName. Terminates: unit productions over strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/charset-syntax.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function charset(Node $charset): CharsetName

Lowers a character set position.

Parameters

$charsetNode

Throws

ImplementationGap When the production has no rule
Test cases 1
Calls 2
public function collation(Node $collation): ?CollationName

Lowers a collation position; an absent COLLATE clause is null.

Parameters

$collationNode

Throws

ImplementationGap When the production has no rule
Test cases 1
Calls 2

Private surface 5§

Implementation details, listed for orientation only.

private const FORWARD = ['charset_name_or_default: charset_name' => true, 'old_or_new_charset_name_or_d…
private const NAMED = ['charset_name: ident_or_text' => true, 'old_or_new_charset_name: ident_or_text…
private const BINARY = ['charset_name: BINARY' => true, 'charset_name: BINARY_SYM' => true, 'old_or_ne…
private const UNNAMED = ['charset_name_or_default: DEFAULT' => true, 'old_or_new_charset_name_or_defaul…
private Lowering $lowering

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 1
Type declarations 1