classResetBinaryLogs
final class ResetBinaryLogs
implements ResetTarget
uses Snapshot
@visibility public.RESET BINARY LOGS AND GTIDS [TO n], written RESET MASTER in the legacy vocabulary.
Mirrors the REFRESH_SOURCE flag of SQLCOM_RESET with LEX::next_binlog_file_nr. The vocabulary is the one of the release (MYSQL-REPLICATION-RELEASE-001): RESET MASTER up to 8.1, RESET BINARY LOGS AND GTIDS from 8.2, where 8.2 and 8.3 read RESET MASTER as its synonym. TO needs MySQL 8.0 or later. Facts: a TO number with a fraction (ER_ONLY_INTEGERS_ALLOWED), or 0 or greater than 2000000000 (ER_RESET_SOURCE_TO_VALUE_OUT_OF_RANGE), is a RefusedSetting diagnostic. Source: https://dev.mysql.com/doc/refman/8.4/en/reset-binary-logs-and-gtids.html, https://dev.mysql.com/doc/refman/8.0/en/reset-master.html, https://dev.mysql.com/doc/relnotes/mysql/8.2/en/news-8-2-0.html.
(new \SqlSemantics\Platform\MySql\Semantics('mysql-8.3.0'))->analyze('reset master to 5')->toString() // => 'RESET BINARY LOGS AND GTIDS TO 5'Properties§
public Terminology $terminologypublic Numeral|null $first = nullMethods§
public function __construct(public Terminology $terminology, public Numeral|null $first = null)Parameters
$terminology | Terminology | The vocabulary of the release |
$first | Numeral|null | The number of the first new binary log file, when TO is written |
public function deriveTarget(Derivation $derivation): voidChecks the vocabulary and TO against the release and reports a refused file number.
Parameters
$derivation | Derivation |
Calls 13
- new Releases line 59
- static-call Check::input() line 60
- method-call Releases::binaryLogs() line 60
- method-call Releases::legacy() line 61
- new Magnitudes line 65
- method-call Magnitudes::fractional() line 66
- method-call Derivation::report() line 67
- new RefusedSetting line 67
- class-const ReplicationError::FractionalNumber() line 67
- method-call Magnitudes::integer() line 68
- method-call Magnitudes::exceeds() line 68
- class-const ResetBinaryLogs::LAST() line 68
- class-const ReplicationError::FileNumberOutOfRange() line 69
public function render(Output $out): voidWrites the item.
Parameters
$out | Output |
Calls 2
- class-const Terminology::Legacy() line 78
- method-call Output::keyword() line 79
Private surface 1§
Implementation details, listed for orientation only.
private const LAST = 2000000000Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ResetBinaryLogsTestcalls