Function mz_storage::source::mysql::replication::events::handle_query_event
source · pub(super) async fn handle_query_event(
event: QueryEvent<'_>,
ctx: &mut ReplContext<'_>,
new_gtid: &GtidPartition,
) -> Result<bool, TransientError>
Expand description
Handles QueryEvents from the MySQL replication stream. Since we only use row-based replication, we only expect to see QueryEvents for DDL changes.
From the MySQL docs: ‘A Query_event is created for each query that modifies the database, unless the query is logged row-based.’ This means that we can expect any DDL changes to be represented as QueryEvents, which we must parse to figure out if any of the tables we care about have been affected.
This function returns a bool to represent whether the event that was handled represents a ‘complete’ event that should cause the frontier to advance beyond the current GTID.