final class StartReplica
    implements Statement
    uses Snapshot
Public API: explicitly declared with @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.

Starting the receiver thread with credentialsdoctest
(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> $threads
public Terminology $terminology
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

Methods§

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

$terminologyTerminologyThe spelling: START SLAVE or START REPLICA
$threadslist<ReplicaThread>The threads in written order; empty for both
$untilReplicaUntil|nullThe UNTIL clause, when written
$userText|nullThe USER option, when written
$passwordText|nullThe PASSWORD option, when written
$defaultAuthText|nullThe DEFAULT_AUTH option, when written
$pluginDirText|nullThe PLUGIN_DIR option, when written
$channelText|nullThe replication channel, when FOR CHANNEL is written
Calls 2
public function deriveStatement(Derivation $derivation): void
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 4

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
Type declarations 2