final class SystemAssignment
    implements SetItem
    uses Snapshot
Public API: explicitly declared with @visibility public.

An assignment to a system variable named with @@: SET @@GLOBAL.x = v, SET @@x = DEFAULT.

Rule: MYSQL-SET-ITEM-001 (system variables). The scope written inside @@ applies to this variable only; without one the session value is assigned. The variable is derived as a system variable reference, the value as an expression at a position that sees no relation; a keyword value (SetWord) has no facts, and a bare name value is its text (MYSQL-SET-WORD-001). Diagnostics: none, as the variables of the running server are not part of the context. Terminates: the parts are leaves. Source: https://dev.mysql.com/doc/refman/8.4/en/set-variable.html. Status: Implemented.

Reading a persisted assignmentdoctest
$set = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SET @@PERSIST.max_connections = 10');
    [$set->statement->items[0]->variable->scope, $set->toString()] // => [\SqlSemantics\Platform\MySql\Statement\Variable\VariableScope::Persist, 'SET @@PERSIST.max_connections = 10']

Properties§

public SystemVariable $variable
public Scalar|SetWord $value

Methods§

public function __construct(public SystemVariable $variable, public Scalar|SetWord $value)

Parameters

$variableSystemVariableThe assigned variable with the scope written inside `@@`
$valueScalar|SetWordThe value: an expression, or a keyword the grammar accepts there
Calls 1
public function deriveItem(Derivation $derivation): void

Derives the variable and the value.

Parameters

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

Writes the variable, an equals sign and the value.

Parameters

$outOutput
Calls 2

Test cases 4§

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 2

Relations§

Instantiated in 2
Type checks 1