classSourceOption
final class SourceOption
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One option = value of CHANGE REPLICATION SOURCE TO, or one log position of the UNTIL condition of START REPLICA.
Mirrors one field of the server's LEX_SOURCE_INFO. The value is typed by the option (SourceOptionKind::accepts); NULL is the value null, accepted by PRIVILEGE_CHECKS_USER and SOURCE_TLS_CIPHERSUITES. The option is written in the vocabulary of its statement. Source: https://dev.mysql.com/doc/refman/8.4/en/change-replication-source-to.html.
$option = new \SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOption(\SqlSemantics\Platform\MySql\Statement\Replication\Terminology::Current, \SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind::Port, new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('3306'));
$option->kind->value // => 'SOURCE_PORT'Properties§
public Terminology $terminologypublic SourceOptionKind $kindpublic Text|Numeral|NumberLiteral|ServerIds|AccountName|PrimaryKeyCheck|AnonymousGtids|null $valueMethods§
public function __construct(
public Terminology $terminology,
public SourceOptionKind $kind,
public Text|Numeral|NumberLiteral|ServerIds|AccountName|PrimaryKeyCheck|AnonymousGtids|null $value,
)Parameters
$terminology | Terminology | The vocabulary of the statement the option belongs to |
$kind | SourceOptionKind | The option |
$value | Text|Numeral|NumberLiteral|ServerIds|AccountName|PrimaryKeyCheck|AnonymousGtids|null | The value, of the domain of the option |
Calls 2
- static-call Check::input() line 45
- method-call SourceOptionKind::accepts() line 45
public function render(Output $out): voidWrites the option, = and the value.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 53
- method-call SourceOptionKind::keyword() line 53
- method-call Output::node() line 59
Test cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 6
ReplicaConditionsTest::testUntilAcceptsCompletePositionsAndLoneConditionscallsSourceSettingsTest::testErrorAnswersTheCheckOfEachValueKindcallsSourceSettingsTest::testOptionRejectsAnOptionOfALaterReleasecallsReplicaUntilTest::testPositionsRejectAnOptionThatIsNotAPositioncallsChangeReplicationSourceTest::testDeriveStatementRejectsAnOptionOfALaterReleasecallsChangeReplicationSourceTest::testDeriveStatementRejectsTheVocabularyOfAnotherReleasecalls
Relations§
Instantiated in 1
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Statement\Replication\Replica\ReplicaUntil::__construct() packages/sql-semantics-mysql/src/Statement/Replication/Replica/ReplicaUntil.php:43
- class-const SqlSemantics\Platform\MySql\Statement\Replication\Source\ChangeReplicationSource::__construct() packages/sql-semantics-mysql/src/Statement/Replication/Source/ChangeReplicationSource.php:54
Type declarations 3
- type SqlSemantics\Platform\MySql\Lowering\Replication\SourceOptionRule packages/sql-semantics-mysql/src/Lowering/Replication/SourceOptionRule.php:207
- type SqlSemantics\Platform\MySql\Rules\Replication\SourceSettings packages/sql-semantics-mysql/src/Rules/Replication/SourceSettings.php:72
- type SqlSemantics\Platform\MySql\Rules\Replication\SourceSettings packages/sql-semantics-mysql/src/Rules/Replication/SourceSettings.php:88