classFlushTables
final class FlushTables
implements Statement
uses Snapshot
@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.
$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> $tablespublic bool $noWriteToBinlogpublic FlushLock|null $lock = nullMethods§
public function __construct(
public bool $noWriteToBinlog,
list<MaintainedTable> $tables = [],
public FlushLock|null $lock = null,
)Parameters
$noWriteToBinlog | bool | Whether NO_WRITE_TO_BINLOG or its synonym LOCAL is written |
$tables | list<MaintainedTable> | The tables in written order; empty for every open table |
$lock | FlushLock|null | WITH READ LOCK or FOR EXPORT, when written |
Throws
InvalidConstruction When FOR EXPORT has no table listCalls 4
- static-call Check::listOf() line 50
- class-const MaintainedTable::class() line 50
- static-call Check::input() line 51
- class-const FlushLock::ForExport() line 51
public function deriveStatement(Derivation $derivation): voidRecords the resolution of each table and reports a table named twice.
Parameters
$derivation | Derivation |
Calls 2
- method-call MaintainedTables::derive() line 59
- new MaintainedTables line 59
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call MaintainedTables::render() line 67
- new MaintainedTables line 67
- method-call Output::keyword() line 69
- function-call
explodeline 69
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.