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

LOCK {TABLE | TABLES} t [[AS] alias] lock_type, …: a request to lock tables for the session.

Mirrors SQLCOM_LOCK_TABLES. Rule: MYSQL-LOCK-TABLES-001. Each table name resolves by MYSQL-SERVER-TABLES-001 and its resolution is the relation fact of its TableLock; an alias or name used twice is NonUniqueTable. The statement releases the locks the session held before. TABLE and TABLES are synonyms; TABLES is written. Source: https://dev.mysql.com/doc/refman/8.4/en/lock-tables.html. Status: Implemented.

Locking two tablesdoctest
$lock = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('lock table t read local, u as v write');
    [$lock->toString(), $lock->statement->locks[1]->alias?->value] // => ['LOCK TABLES t READ LOCAL, u AS v WRITE', 'v']

Properties§

public list<TableLock> $locks

Methods§

public function __construct(list<TableLock> $locks)

Parameters

$lockslist<TableLock>The locked tables in written order; at least one

Throws

InvalidConstruction When the list is empty
Calls 2
public function deriveStatement(Derivation $derivation): void

Records the resolution of each table and reports a repeated alias.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 1

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type checks 1
Type declarations 1