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

A value with an explicit collation: x COLLATE collation (Item_func_set_collation).

COLLATE is the tightest operator; a chain of COLLATE clauses applies from the left (MYSQL-PRECEDENCE-001).

Rule: MYSQL-COLLATE-001. Facts: the type and NULL fact of the operand; the collation is part of the comparison semantics the server applies, and the character set of the operand must admit it, which needs the collation catalog of the server and is not checked. Terminates: the operand is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/charset-collate.html. Status: Implemented.

Reading the collationdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT a FROM t WHERE a COLLATE utf8mb4_bin = 'x'");
    $query->statement->where->left->collation->value // => 'utf8mb4_bin'

Properties§

public Scalar $operand
public Name $collation

Methods§

public function __construct(public Scalar $operand, public Name $collation)

Parameters

$operandScalarThe collated expression
$collationNameThe collation name
Calls 5
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand; the collated value has its facts.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the operand, COLLATE and the collation name.

Parameters

$outOutput
Test cases 1
Calls 2

Test cases 6§

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

Dedicated tests 3
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Type checks 1