classSetCharacterSet
final class SetCharacterSet
implements SetItem
uses Snapshot
@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.
$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 $charsetMethods§
public function __construct(public CharsetName $charset)Parameters
$charset | CharsetName | The character set, or DEFAULT |
public function deriveItem(Derivation $derivation): voidDerives nothing: the name is resolved by the server.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites CHARSET and the character set.
Parameters
$out | Output |
Calls 1
- method-call Output::keyword() line 52
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.