classSourceSettings
final class SourceSettings
Derives the options of CHANGE REPLICATION SOURCE and the log positions of UNTIL, and the checks the server applies to their values.
Rule: MYSQL-REPLICATION-SOURCE-001. An option needs a release that has it (MYSQL-REPLICATION-RELEASE-001). The heartbeat period is a number literal and receives its scalar fact. The server's parser refuses: a line feed in a value read by TEXT_STRING_sys_nonewline (every string option except SOURCE_COMPRESSION_ALGORITHMS, ER_WRONG_VALUE); a password of more than 32 bytes (5.7 and later); a delay greater than 2147483647 (MASTER_DELAY_MAX); a heartbeat period greater than 4294967 seconds (REPLICA_MAX_HEARTBEAT_PERIOD, compared as the server does after converting to a floating number); REQUIRE_ROW_FORMAT, SOURCE_CONNECTION_AUTO_FAILOVER and GTID_ONLY other than 0 or 1, and a fraction in the last two; an anonymous GTID UUID whose first 36 characters are not a UUID in its text form. Each is a RefusedSetting diagnostic. Terminates: one pass over the options. Source: sql/sql_yacc.yy (source_def, master_def, TEXT_STRING_sys_nonewline, assign_gtids_to_anonymous_transactions_def), https://dev.mysql.com/doc/refman/8.4/en/change-replication-source-to.html. Status: Implemented.
Methods§
public function options(Derivation $derivation, list<SourceOption> $options): voidDerives every option.
Parameters
$derivation | Derivation | |
$options | list<SourceOption> |
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:87
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:70
Calls 1
- method-call SourceSettings::option() line 65
public function option(Derivation $derivation, SourceOption $option): voidDerives one option and reports a refused value.
Parameters
$derivation | Derivation | |
$option | SourceOption |
Called from 1
Calls 8
- static-call Check::input() line 75
- method-call Releases::option() line 75
- new Releases line 75
- method-call Derivation::scalar() line 77
- method-call Derivation::environment() line 77
- method-call SourceSettings::error() line 79
- method-call Derivation::report() line 81
- new RefusedSetting line 81
public function error(SourceOption $option, GrammarRelease $release): ?ReplicationErrorAnswers the check an option value fails, if any.
Parameters
$option | SourceOption | |
$release | GrammarRelease |
Returns
Test cases 1
Called from 1
Calls 4
- method-call SourceSettings::text() line 92
- method-call SourceSettings::number() line 95
- class-const SourceSettings::HEARTBEAT() line 98
- class-const ReplicationError::HeartbeatOutOfRange() line 98
public function text(
SourceOptionKind $kind,
Text $value,
GrammarRelease $release,
): ?ReplicationErrorAnswers the check a string value fails, if any.
Parameters
$kind | SourceOptionKind | |
$value | Text | |
$release | GrammarRelease |
Returns
Test cases 1
Called from 1
Calls 11
- class-const SourceOptionKind::AssignGtidsToAnonymousTransactions() line 109
- function-call
preg_matchline 110 - class-const ReplicationError::InvalidUuid() line 110
- class-const SourceOptionKind::CompressionAlgorithms() line 112
- function-call
str_containsline 112 - class-const ReplicationError::LineFeed() line 113
- class-const SourceOptionKind::Password() line 115
- class-const GrammarRelease::MySql5651() line 115
- function-call
strlenline 115 - class-const SourceSettings::PASSWORD() line 115
- class-const ReplicationError::PasswordTooLong() line 116
public function number(SourceOptionKind $kind, Numeral $value): ?ReplicationErrorAnswers the check a number value fails, if any.
Parameters
$kind | SourceOptionKind | |
$value | Numeral |
Returns
Test cases 1
Called from 1
Calls 13
- new Magnitudes line 127
- class-const SourceOptionKind::ConnectionAutoFailover() line 128
- class-const SourceOptionKind::GtidOnly() line 128
- method-call Magnitudes::fractional() line 129
- class-const ReplicationError::FractionalNumber() line 129
- method-call Magnitudes::flag() line 129
- class-const ReplicationError::SwitchValue() line 129
- class-const SourceOptionKind::RequireRowFormat() line 131
- class-const ReplicationError::RowFormatValue() line 132
- class-const SourceOptionKind::Delay() line 134
- method-call Magnitudes::exceeds() line 135
- class-const SourceSettings::DELAY() line 135
- class-const ReplicationError::DelayOutOfRange() line 135
public function lineFeed(Derivation $derivation, ?Text $value): voidReports a line feed in a string the server reads with TEXT_STRING_sys_nonewline.
Parameters
$derivation | Derivation | |
$value | ?Text |
Called from 7
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Filter\ChangeReplicationFilter::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Filter/ChangeReplicationFilter.php:66
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Filter\ChangeReplicationFilter::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Filter/ChangeReplicationFilter.php:73
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Group\StartGroupReplication::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Group/StartGroupReplication.php:64
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:97
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StopReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StopReplica.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Reset\ResetReplica::deriveTarget() packages/sql-semantics-mysql/src/Statement/Replication/Reset/ResetReplica.php:53
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:71
Calls 4
- function-call
str_containsline 146 - method-call Derivation::report() line 147
- new RefusedSetting line 147
- class-const ReplicationError::LineFeed() line 147
Private surface 3§
Implementation details, listed for orientation only.
private const PASSWORD = 32private const DELAY = 2147483647private const HEARTBEAT = 4294967Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 7
- new SqlSemantics\Platform\MySql\Statement\Replication\Filter\ChangeReplicationFilter::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Filter/ChangeReplicationFilter.php:62
- new SqlSemantics\Platform\MySql\Statement\Replication\Group\StartGroupReplication::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Group/StartGroupReplication.php:64
- new SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:87
- new SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:97
- new SqlSemantics\Platform\MySql\Statement\Replication\Replica\StopReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StopReplica.php:60
- new SqlSemantics\Platform\MySql\Statement\Replication\Reset\ResetReplica::deriveTarget() packages/sql-semantics-mysql/src/Statement/Replication/Reset/ResetReplica.php:53
- new SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:69
Method calls 9
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Filter\ChangeReplicationFilter::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Filter/ChangeReplicationFilter.php:66
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Filter\ChangeReplicationFilter::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Filter/ChangeReplicationFilter.php:73
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Group\StartGroupReplication::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Group/StartGroupReplication.php:64
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:87
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StartReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StartReplica.php:97
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Replica\StopReplica::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Replica/StopReplica.php:60
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Reset\ResetReplica::deriveTarget() packages/sql-semantics-mysql/src/Statement/Replication/Reset/ResetReplica.php:53
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:70
- method-call SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::deriveStatement() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:71