Skip to content

Patch float with trailing zero for JSON and add useFloatWithTrailingZero flag #1038

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

chenhuiyeh
Copy link

@chenhuiyeh chenhuiyeh commented May 21, 2025

We have patched go-mysql to keep trailing zero in floats in json: Shopify/ghostferry#368

This will only work with mysql version 8 onwards. To enable this, useFloatWithTrailingZero setting option has been added.

Part of Shopify/ghostferry#384

@chenhuiyeh chenhuiyeh changed the title batch float with trailing zero and add a useFloatWithTrailingZero fla… patch float with trailing zero and add useFloatWithTrailingZero flag May 21, 2025
@dveeden
Copy link
Collaborator

dveeden commented May 21, 2025

It would be good to add some tests and a description or an issue link.

@chenhuiyeh chenhuiyeh changed the title patch float with trailing zero and add useFloatWithTrailingZero flag Patch float with trailing zero for JSON and add useFloatWithTrailingZero flag May 21, 2025
// Type assert to RowsEvent
rowsEvent := evt.Event.(*RowsEvent)
for _, row := range rowsEvent.Rows {
// The third row should contain our test values

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean row or column?

@chenhuiyeh chenhuiyeh force-pushed the float_with_trailing_zero branch from 814aa96 to 9d46fb3 Compare May 21, 2025 19:29
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.

3 participants