Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend inline verifier to do deep comparison of json objects #355

Closed

Conversation

mtaner
Copy link

@mtaner mtaner commented Aug 6, 2024

Inline verifier checks were failing when binlog streamed event includes a json that contains a float value with trailing 0, e.g. {"amount": 15.0 }. go-mysql is parsing this with (json unmarshall/marshall) to {"amount": 15 }. As inline verifier is using checksum check for the whole row, this is failing, even though 15.0 & 15 can be considered the same. (this does not apply to values such as 15.123, these are all copied correctly.)

So as a fix if the checksum check fails, this logic will check for any json column and if they are present, then it will do a deep comparison between json values.

Very new to golang, so welcoming suggestions for improvements or anything I might have missed in the logic.

@mtaner mtaner marked this pull request as ready for review August 6, 2024 15:59
inline_verifier.go Outdated Show resolved Hide resolved
@mtaner mtaner force-pushed the mt/inline-verifier-to-support-json-float-mismatch branch from 4376c22 to ed9a90b Compare August 7, 2024 15:58
@mtaner mtaner closed this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants