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

A local variable of a stored program used as the count of NTILE or the offset of LEAD and LAG.

Rule: MYSQL-ROUTINE-VARIABLE-001. The server reads the name as a routine variable (PTI_int_splocal); outside a stored program it is the error ER_SP_UNDECLARED_VAR. The value is program state the context does not hold. Terminates: a leaf. Source: https://dev.mysql.com/doc/refman/8.4/en/window-function-descriptions.html#function_ntile. Status: Implemented.

Depending on the program statedoctest
(new \SqlSemantics\Platform\MySql\Statement\Call\Window\RoutineVariable(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('n')))->name->value // => 'n'

Properties§

public Name $name

Methods§

public function __construct(public Name $name)

Parameters

$nameNameThe variable name
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Answers that the value depends on the state of the stored program.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the name.

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
Type checks 1