classFlush
final class Flush
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.FLUSH [NO_WRITE_TO_BINLOG | LOCAL] item, …: a request to clear or reload server caches and logs.
Mirrors SQLCOM_FLUSH with the REFRESH_* flags of LEX::type. Rule: MYSQL-FLUSH-001. The items are kept in written order; the server merges them into flags. LOCAL is a synonym of NO_WRITE_TO_BINLOG, which is written. The statement names no relation and has no facts. Source: https://dev.mysql.com/doc/refman/8.4/en/flush.html. Status: Implemented.
$flush = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('flush local binary logs, privileges');
[$flush->toString(), $flush->statement->items[1]->option] // => ['FLUSH NO_WRITE_TO_BINLOG BINARY LOGS, PRIVILEGES', \SqlSemantics\Platform\MySql\Statement\Server\Flush\FlushOption::Privileges]Properties§
public list<FlushItem> $itemspublic bool $noWriteToBinlogMethods§
public function __construct(public bool $noWriteToBinlog, list<FlushItem> $items)Parameters
$noWriteToBinlog | bool | Whether NO_WRITE_TO_BINLOG or its synonym LOCAL is written |
$items | list<FlushItem> | The items in written order; at least one |
Throws
InvalidConstruction When the list is emptyCalls 2
- static-call Check::listOf() line 45
- class-const FlushItem::class() line 45
public function deriveStatement(Derivation $derivation): voidHas nothing to derive: the request names no relation and no value.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 60
- method-call Output::list() line 64
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
FlushTestcalls