classPurgeLogsBefore
final class PurgeLogsBefore
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.PURGE BINARY LOGS BEFORE datetime_expr: deletes the binary log files older than a moment.
Mirrors SQLCOM_PURGE_BEFORE with LEX::purge_value_list. The moment is an expression the server evaluates as a DATETIME; it is derived in an environment that sees no table. MASTER LOGS is a synonym of BINARY LOGS up to 8.3 and is written BINARY LOGS. Rule: MYSQL-PURGE-002. Facts: the facts of the expression. Source: https://dev.mysql.com/doc/refman/8.4/en/purge-binary-logs.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze("purge binary logs before '2024-01-01 00:00:00'")->toString() // => "PURGE BINARY LOGS BEFORE '2024-01-01 00:00:00'"Properties§
public Scalar $momentMethods§
public function __construct(public Scalar $moment)Parameters
$moment | Scalar | The moment: files last modified before it are deleted |
public function deriveStatement(Derivation $derivation): voidDerives the moment in an environment without tables.
Parameters
$derivation | Derivation |
Calls 2
- method-call Derivation::scalar() line 44
- method-call Derivation::environment() line 44
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.