final class SetCharacterSet
    implements SetItem
    uses Snapshot
Public API: explicitly declared with @visibility public.

SET CHARACTER SET: sets the client and result character sets and makes the connection use the database character set.

Rule: MYSQL-SET-CHARSET-001. SET CHARACTER SET cs sets character_set_client and character_set_results to cs and character_set_connection to the value of character_set_database; DEFAULT restores the defaults. CHARACTER SET, CHAR SET and CHARSET are the same keyword (LeafNoise); the writer emits CHARSET. Facts: none. Terminates: the part is a leaf. Source: https://dev.mysql.com/doc/refman/8.4/en/set-character-set.html. Status: Implemented.

Reading SET CHARACTER SETdoctest
$set = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SET CHARACTER SET DEFAULT');
    [$set->statement->items[0]->charset->name, $set->toString()] // => [null, 'SET CHARSET DEFAULT']

Properties§

public CharsetName $charset

Methods§

public function __construct(public CharsetName $charset)

Parameters

$charsetCharsetNameThe character set, or DEFAULT
public function deriveItem(Derivation $derivation): void

Derives nothing: the name is resolved by the server.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes CHARSET and the character set.

Parameters

$outOutput
Calls 1

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 1