final class CharCall
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A call of CHAR(): the characters whose codes the arguments are, in a binary string or in the character set written after USING.

Rule: MYSQL-CHAR-CALL-001. NULL arguments are skipped, so the result is never NULL; without USING it is a binary string, with USING a character string. Terminates: the arguments are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_char. Status: Implemented.

Typing CHAR() with a character setdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT CHAR(77, 121 USING utf8mb4)');
    [$query->field(0)->type->descriptor->name(), $query->field(0)->nullability] // => ['VARCHAR', \SqlSemantics\Platform\MySql\Model\Statement\Type\Nullability::NotNull]

Properties§

public list<Scalar> $arguments
public CharsetName|null $charset = null

Methods§

public function __construct(list<Scalar> $arguments, public CharsetName|null $charset = null)

Parameters

$argumentslist<Scalar>The character codes in order; at least one
$charsetCharsetName|nullThe character set written after USING
Calls 2
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the codes; the result is a string that is never NULL.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 7
public function render(Output $out): void

Writes the call.

Parameters

$outOutput
Test cases 1
Calls 2

Test cases 3§

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

Dedicated tests 2
Other tests reaching this symbol 1

Relations§

Instantiated in 2