Skip to main content

ReplicationStatement

Enum ReplicationStatement 

Source
pub enum ReplicationStatement {
    ChangeSource {
        options: ThinVec<ChangeReplicationSourceOption>,
        channel: Option<Literal>,
        meta: Meta,
    },
    ChangeFilter {
        rules: ThinVec<ReplicationFilterRule>,
        channel: Option<Literal>,
        meta: Meta,
    },
    StartReplica {
        threads: ThinVec<ReplicaThreadOption>,
        until: ThinVec<ReplicaUntilCondition>,
        user: Option<Literal>,
        password: Option<Literal>,
        default_auth: Option<Literal>,
        plugin_dir: Option<Literal>,
        channel: Option<Literal>,
        meta: Meta,
    },
    StopReplica {
        threads: ThinVec<ReplicaThreadOption>,
        channel: Option<Literal>,
        meta: Meta,
    },
    StartGroupReplication {
        options: ThinVec<GroupReplicationOption>,
        meta: Meta,
    },
    StopGroupReplication {
        meta: Meta,
    },
}
Expand description

A MySQL replication-administration statement — the boxed payload of Statement::Replication.

Six verbs across the five measured families ride one enum because they are one dialect unit reached through the replication-specific leading-keyword sequences. START/STOP GROUP_REPLICATION are two variants (the two verbs carry different tails — only START takes options) of the single GROUP REPLICATION family.

Variants§

§

ChangeSource

CHANGE REPLICATION SOURCE TO <option-list> [FOR CHANNEL '<ch>'].

The option list is non-empty (a bare CHANGE REPLICATION SOURCE TO is ER_PARSE_ERROR on mysql:8.4.10) and comma-separated; each element is a ChangeReplicationSourceOption. FOR CHANNEL is a trailing suffix, not a list member — an option after the channel (… FOR CHANNEL 'c', SOURCE_PORT = 1) rejects.

Fields

§options: ThinVec<ChangeReplicationSourceOption>

The <name> = <value> options in source order; always non-empty.

§channel: Option<Literal>

The optional FOR CHANNEL '<name>' replication-channel name.

§meta: Meta

Source location and node identity.

§

ChangeFilter

CHANGE REPLICATION FILTER <rule-list> [FOR CHANNEL '<ch>'].

The rule list is non-empty and comma-separated; each element is a ReplicationFilterRule.

Fields

§rules: ThinVec<ReplicationFilterRule>

The filter rules in source order; always non-empty.

§channel: Option<Literal>

The optional FOR CHANNEL '<name>' replication-channel name.

§meta: Meta

Source location and node identity.

§

StartReplica

START REPLICA [<thread-list>] [UNTIL <cond-list>] [USER='u'] [PASSWORD='p'] [DEFAULT_AUTH='a'] [PLUGIN_DIR='d'] [FOR CHANNEL '<ch>'].

The connection options are four independent fixed-order optionals (MySQL’s opt_user_optionopt_plugin_dir_option, space-separated — not a comma list, unlike StartGroupReplication). Each may appear alone (START REPLICA PASSWORD = 'p' is grammar-valid on mysql:8.4.10).

Fields

§threads: ThinVec<ReplicaThreadOption>

The SQL_THREAD/IO_THREAD thread-type list (opt_replica_thread_option_list); empty when none was written (start both threads).

§until: ThinVec<ReplicaUntilCondition>

The UNTIL <cond-list> stop condition (opt_replica_until); empty when no UNTIL was written. See ReplicaUntilCondition.

§user: Option<Literal>

The USER = '<u>' connection user; None when absent.

§password: Option<Literal>

The PASSWORD = '<p>' connection password; None when absent.

§default_auth: Option<Literal>

The DEFAULT_AUTH = '<a>' authentication plugin; None when absent.

§plugin_dir: Option<Literal>

The PLUGIN_DIR = '<d>' plugin directory; None when absent.

§channel: Option<Literal>

The optional FOR CHANNEL '<name>' replication-channel name.

§meta: Meta

Source location and node identity.

§

StopReplica

STOP REPLICA [<thread-list>] [FOR CHANNEL '<ch>'].

Unlike StartReplica, STOP REPLICA takes no UNTIL or connection tail — STOP REPLICA UNTIL … / STOP REPLICA USER = … is ER_PARSE_ERROR on mysql:8.4.10.

Fields

§threads: ThinVec<ReplicaThreadOption>

The SQL_THREAD/IO_THREAD thread-type list; empty when none was written.

§channel: Option<Literal>

The optional FOR CHANNEL '<name>' replication-channel name.

§meta: Meta

Source location and node identity.

§

StartGroupReplication

START GROUP_REPLICATION [<option-list>].

The options are USER/PASSWORD/DEFAULT_AUTH in any order, comma-separated (group_replication_start_options — the distinguishing difference from StartReplica’s space-separated fixed-order tail), so they ride an ordered list. Empty when none was written.

Fields

§options: ThinVec<GroupReplicationOption>

The connection options in source order; empty when none was written.

§meta: Meta

Source location and node identity.

§

StopGroupReplication

STOP GROUP_REPLICATION — takes no options (STOP GROUP_REPLICATION USER = … is ER_PARSE_ERROR on mysql:8.4.10).

Fields

§meta: Meta

Source location and node identity.

Trait Implementations§

Source§

impl Clone for ReplicationStatement

Source§

fn clone(&self) -> ReplicationStatement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReplicationStatement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ReplicationStatement

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ReplicationStatement

Source§

impl Hash for ReplicationStatement

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ReplicationStatement

Source§

fn eq(&self, other: &ReplicationStatement) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Render for ReplicationStatement

Source§

fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result

Return the render for this value.
Source§

fn operand_binding_power(&self) -> Option<BindingPower>

The binding power this node contributes when it appears as an operand, or None (the default) for a self-delimiting node — an atom, call, or constructor — that never needs parentheses. Read more
Source§

impl Serialize for ReplicationStatement

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Spanned for ReplicationStatement

Source§

fn span(&self) -> Span

Return the span for this value.
Source§

impl StructuralPartialEq for ReplicationStatement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynAstExt for T
where T: Extension + Render + 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Erase to &dyn Any for downcasting a node back to its concrete type.
Source§

fn dyn_clone(&self) -> Box<dyn DynAstExt>

Clone into a fresh box — the object-safe stand-in for Clone (whose Self-returning signature cannot go through a vtable).
Source§

fn dyn_eq(&self, other: &dyn DynAstExt) -> bool

Structural equality against another erased node — the object-safe stand-in for PartialEq (whose &Self argument cannot go through a vtable). Equal iff other holds the same concrete type and that type deems the values equal; differently-typed nodes are never equal.
Source§

fn dyn_hash(&self, state: &mut dyn Hasher)

Feed this node’s hash into an erased hasher — the object-safe stand-in for Hash::hash (whose generic H: Hasher cannot go through a vtable).
Source§

impl<T> Extension for T
where T: Clone + Debug + Eq + Hash + Spanned,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> RenderExt for T
where T: Render,

Source§

fn displayed<'a>(&'a self, ctx: &'a RenderCtx<'a>) -> Displayed<'a, T>

Pair this node with an explicit canonical RenderCtx so format!, to_string, and {} render it. This is the canonical path: the ctx’s resolver and source must match the node’s parse.
Source§

fn debug_sql<'a>(&'a self, resolver: &'a dyn Resolver) -> DebugSql<'a, Self>
where Self: Sized,

Render this node for debugging against an explicitly-supplied resolver (the debug-SQL mitigation), returning a Display adapter. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.