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.

Purging the logs before a momentdoctest
(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 $moment

Methods§

public function __construct(public Scalar $moment)

Parameters

$momentScalarThe moment: files last modified before it are deleted
public function deriveStatement(Derivation $derivation): void

Derives the moment in an environment without tables.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 1

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