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

HANDLER ... OPEN: opens a table for direct reads under its name or an alias.

Rule: MYSQL-HANDLER-OPEN-001. The table name resolves like a table reference (MYSQL-TABLE-SHAPES-001) and is recorded as a table use of the statement; a declared view is refused (MYSQL-RELATION-KIND-001). The statement returns no rows. Terminates: no child. Source: https://dev.mysql.com/doc/refman/8.4/en/handler.html. Status: Implemented.

Reading a HANDLER ... OPENdoctest
$open = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('HANDLER shop.t OPEN AS h');
    [$open->statement->table->name->value, $open->statement->alias?->value, $open->toString()] // => ['t', 'h', 'HANDLER shop.t OPEN AS h']

Properties§

public QualifiedName $table
public Name|null $alias = null
public AliasMark $mark = AliasMark::As

Methods§

public function __construct(
    public QualifiedName $table,
    public Name|null $alias = null,
    public AliasMark $mark = AliasMark::As,
)

Parameters

$tableQualifiedNameThe table with its optional database
$aliasName|nullThe name of the handler; the table name when absent
$markAliasMarkWhat is written before the alias
Calls 2
public function deriveStatement(Derivation $derivation): void

Resolves the table and records it as the table use of the statement.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 6

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