final class Execute
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

EXECUTE: runs a prepared statement with user variables for its parameter markers.

Rule: MYSQL-EXECUTE-001. The prepared statement is a session object; what it does and whether it returns rows depends on the text it was prepared from, so the statement records no rows. The variables are derived as session values. Terminates: one pass over the variables. Source: https://dev.mysql.com/doc/refman/8.4/en/execute.html. Status: Implemented.

Reading an EXECUTEdoctest
$execute = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('EXECUTE stmt USING @a, @b');
    [count($execute->statement->variables), $execute->toString()] // => [2, 'EXECUTE stmt USING @a, @b']

Properties§

public list<UserVariable> $variables
public Name $name

Methods§

public function __construct(public Name $name, list<UserVariable> $variables = [])

Parameters

$nameNameThe name of the prepared statement
$variableslist<UserVariable>The variables that supply the parameter values
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the variables; the statement records no rows.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 2

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 1
Type checks 1