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

FLUSH [NO_WRITE_TO_BINLOG | LOCAL] TABLES [t, …] [WITH READ LOCK | FOR EXPORT]: a request to close open tables.

Mirrors SQLCOM_FLUSH with REFRESH_TABLES. Rule: MYSQL-FLUSH-TABLES-001. Without a list every open table is closed. Each table resolves by MYSQL-SERVER-TABLES-001 and its resolution is the relation fact of its MaintainedTable; a table named twice is NonUniqueTable. FOR EXPORT without a table list is a syntax error of the server and cannot be constructed. TABLE and TABLES are synonyms; TABLE is written. Source: https://dev.mysql.com/doc/refman/8.4/en/flush.html. Status: Implemented.

Flushing tables for exportdoctest
$flush = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('flush tables t, u for export');
    [$flush->toString(), $flush->statement->lock] // => ['FLUSH TABLE t, u FOR EXPORT', \SqlSemantics\Platform\MySql\Statement\Server\Flush\FlushLock::ForExport]

Properties§

public list<MaintainedTable> $tables
public bool $noWriteToBinlog
public FlushLock|null $lock = null

Methods§

public function __construct(
    public bool $noWriteToBinlog,
    list<MaintainedTable> $tables = [],
    public FlushLock|null $lock = null,
)

Parameters

$noWriteToBinlogboolWhether NO_WRITE_TO_BINLOG or its synonym LOCAL is written
$tableslist<MaintainedTable>The tables in written order; empty for every open table
$lockFlushLock|nullWITH READ LOCK or FOR EXPORT, when written

Throws

InvalidConstruction When FOR EXPORT has no table list
Calls 4
public function deriveStatement(Derivation $derivation): void

Records the resolution of each table and reports a table named twice.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 4

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