[mysql source versioning] add binlog setting to mysql source details at purification#36253
Open
patrickwwbutler wants to merge 5 commits intoMaterializeInc:mainfrom
Open
[mysql source versioning] add binlog setting to mysql source details at purification#36253patrickwwbutler wants to merge 5 commits intoMaterializeInc:mainfrom
patrickwwbutler wants to merge 5 commits intoMaterializeInc:mainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
def-
requested changes
Apr 25, 2026
Co-authored-by: Copilot <copilot@github.com>
martykulma
reviewed
Apr 27, 2026
Contributor
martykulma
left a comment
There was a problem hiding this comment.
Thanks @patrickwwbutler - some comments around tidying up.
| Err( | ||
| MySqlSourcePurificationError::UnsupportedBinlogMetadataSetting { | ||
| setting: "Using MySQL version < 8.0.1, which does not support full binlog row metadata".to_string(), | ||
| }, |
Contributor
There was a problem hiding this comment.
This should just be a separate error variant - e.g.
MySqlSourcePurificationError::UnsupportedVersion { version }, or something to that effect.
| } | ||
| let binlog_metadata_setting = | ||
| mz_mysql_util::query_sys_var(&mut conn, "binlog_row_metadata").await?; | ||
| let binlog_full_metadata = binlog_metadata_setting.to_uppercase() == "FULL"; |
Contributor
There was a problem hiding this comment.
prefer .eq_ignore_ascii_case("FULL") over to_uppercase
Comment on lines
+1520
to
+1529
| let binlog_full_metadata = version_compare::compare_to( | ||
| mz_mysql_util::query_sys_var(&mut conn, "version").await?, | ||
| "8.0.1", | ||
| version_compare::Cmp::Ge, | ||
| ) | ||
| .is_ok_and(|is_ge| is_ge) | ||
| && mz_mysql_util::query_sys_var(&mut conn, "binlog_row_metadata") | ||
| .await? | ||
| .to_uppercase() | ||
| == "FULL"; |
Contributor
There was a problem hiding this comment.
Could combine the code into a single helper function that results Result<(), MySqlSourcePurificationError>
-- for boolean --
let binlog_full_metadata = ensure_binlog_full_metadata(&mut conn).await.is_ok();
-- for error --
ensure_binlog_full_metadata(&mut conn).await?;
// binlog_full_metadata is true if the above didn't fail
…ype, use better str cmp function Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now adds a check at sql purification time to see what the binlog setting of the upstream mysql db is, and saves that setting in the mysql source details, so that we can check the original value during replication, and maintain a consistent decoding strategy