final class ChangeReplicationSource
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CHANGE REPLICATION SOURCE TO option = value, … [FOR CHANNEL 'name'], written CHANGE MASTER TO in the legacy vocabulary.

Mirrors SQLCOM_CHANGE_REPLICATION_SOURCE with its LEX_SOURCE_INFO: the options in written order, the same option possibly written more than once (the server keeps the last value). The vocabulary is the one of the release (MYSQL-REPLICATION-RELEASE-001); in 8.0 to 8.3 CHANGE MASTER and the MASTER_ options are read as their current synonyms. A channel needs MySQL 5.7 or later. Rule: MYSQL-CHANGE-SOURCE-001. Facts: the option checks of MYSQL-REPLICATION-SOURCE-001 and a line feed in the channel name. The statement uses no table and provides no declaration. Source: https://dev.mysql.com/doc/refman/8.4/en/change-replication-source-to.html, https://dev.mysql.com/doc/refman/5.7/en/change-master-to.html. Status: Implemented.

Reading the options of the legacy spelling as their current synonymsdoctest
$change = (new \SqlSemantics\Platform\MySql\Semantics('mysql-8.0.44'))->analyze("CHANGE MASTER TO MASTER_HOST = 'h', MASTER_PORT = 3307 FOR CHANNEL 'c'");
    [$change->toString(), $change->statement->options[1]->kind] // => ["CHANGE REPLICATION SOURCE TO SOURCE_HOST = 'h', SOURCE_PORT = 3307 FOR CHANNEL 'c'", \SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind::Port]

Properties§

public list<SourceOption> $options
public Terminology $terminology
public Text|null $channel = null

Methods§

public function __construct(
    public Terminology $terminology,
    list<SourceOption> $options,
    public Text|null $channel = null,
)

Parameters

$terminologyTerminologyThe vocabulary the statement is written in
$optionslist<SourceOption>The options in written order; at least one, each in the vocabulary of the statement
$channelText|nullThe replication channel, when FOR CHANNEL is written
Calls 3
public function deriveStatement(Derivation $derivation): void

Checks the vocabulary of the release and derives the options and the channel.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 2
Other tests reaching this symbol 3

Relations§

Instantiated in 1