classCharCall
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.
$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> $argumentspublic CharsetName|null $charset = nullMethods§
public function __construct(list<Scalar> $arguments, public CharsetName|null $charset = null)Parameters
$arguments | list<Scalar> | The character codes in order; at least one |
$charset | CharsetName|null | The character set written after USING |
Calls 2
- static-call Check::listOf() line 49
- class-const Scalar::class() line 49
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the codes; the result is a string that is never NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 7
- method-call Arguments::one() line 58
- new Arguments line 58
- new ScalarFact line 61
- new Known line 61
- class-const TypeClass::Binary() line 61
- class-const TypeClass::Character() line 61
- class-const Nullability::NotNull() line 61
public function render(Output $out): voidWrites the call.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::keyword() line 69
- method-call Output::symbol() line 73
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.