classStartReplica
final class StartReplica
implements Statement
uses Snapshot
@visibility public.START REPLICA [threads] [UNTIL …] [USER = …] [PASSWORD = …] [DEFAULT_AUTH = …] [PLUGIN_DIR = …] [FOR CHANNEL …], or START SLAVE.
Mirrors SQLCOM_REPLICA_START: the thread flags in written order (none means both threads), the UNTIL condition in LEX_SOURCE_INFO, and the connection options of LEX::replica_connection in their fixed grammar order. The spelling SLAVE or REPLICA is kept (MYSQL-REPLICATION-RELEASE-001); the log positions of UNTIL are in the vocabulary of the release. A channel needs MySQL 5.7 or later. Rule: MYSQL-START-REPLICA-001. Facts: the checks of MYSQL-REPLICA-UNTIL-001 and of the log positions (MYSQL-REPLICATION-SOURCE-001), and a line feed in the channel name, as RefusedSetting diagnostics. Source: https://dev.mysql.com/doc/refman/8.4/en/start-replica.html, https://dev.mysql.com/doc/refman/5.7/en/start-slave.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze("start replica relay_thread user = 'u' password = 'p'")->toString() // => "START REPLICA IO_THREAD USER = 'u' PASSWORD = 'p'"Properties§
public list<ReplicaThread> $threadspublic Terminology $terminologypublic ReplicaUntil|null $until = nullpublic Text|null $user = nullpublic Text|null $password = nullpublic Text|null $defaultAuth = nullpublic Text|null $pluginDir = nullpublic Text|null $channel = nullMethods§
public function __construct(
public Terminology $terminology,
list<ReplicaThread> $threads = [],
public ReplicaUntil|null $until = null,
public Text|null $user = null,
public Text|null $password = null,
public Text|null $defaultAuth = null,
public Text|null $pluginDir = null,
public Text|null $channel = null,
)Parameters
$terminology | Terminology | The spelling: START SLAVE or START REPLICA |
$threads | list<ReplicaThread> | The threads in written order; empty for both |
$until | ReplicaUntil|null | The UNTIL clause, when written |
$user | Text|null | The USER option, when written |
$password | Text|null | The PASSWORD option, when written |
$defaultAuth | Text|null | The DEFAULT_AUTH option, when written |
$pluginDir | Text|null | The PLUGIN_DIR option, when written |
$channel | Text|null | The replication channel, when FOR CHANNEL is written |
Calls 2
- static-call Check::listOf() line 70
- class-const ReplicaThread::class() line 70
public function deriveStatement(Derivation $derivation): voidChecks the release, derives the UNTIL positions and reports refused conditions.
Parameters
$derivation | Derivation |
Calls 15
- new Releases line 79
- static-call Check::input() line 80
- method-call Releases::replica() line 80
- class-const Terminology::Legacy() line 80
- class-const GrammarRelease::MySql5651() line 81
- new ReplicaConditions line 82
- method-call Releases::source() line 85
- method-call SourceSettings::options() line 87
- new SourceSettings line 87
- method-call ReplicaConditions::until() line 88
- method-call Derivation::report() line 90
- new RefusedSetting line 90
- method-call ReplicaConditions::credentialsRefused() line 94
- class-const ReplicationError::ApplierWithCredentials() line 95
- method-call SourceSettings::lineFeed() line 97
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 105
- class-const Terminology::Legacy() line 105
- method-call Output::symbol() line 108
- method-call Output::node() line 112
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.