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

A cast of a value at the local time zone: CAST(expr AT LOCAL AS type [ARRAY]), which the grammar accepts and the server rejects.

Rule: MYSQL-CAST-AT-LOCAL-001. Facts: the server reports ER_NOT_SUPPORTED_YET for AT LOCAL while parsing, so the request is invalid (NotSupportedYet). Terminates: the operand is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/cast-functions.html#function_cast (only AT TIME ZONE is documented). Status: Implemented.

Keeping the rejected formdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE CAST(a AT LOCAL AS DATE)') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: This version of MySQL doesn't yet support 'AT LOCAL'.

Properties§

public Scalar $operand
public CastTarget $target
public bool $array = false

Methods§

public function __construct(
    public Scalar $operand,
    public CastTarget $target,
    public bool $array = false,
)

Parameters

$operandScalarThe cast expression
$targetCastTargetThe target type
$arrayboolWhether ARRAY follows the target type
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand and reports the unsupported form.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes CAST, the operand, AT LOCAL AS, the target and the optional ARRAY in parentheses.

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 1