-
Notifications
You must be signed in to change notification settings - Fork 72
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
Patch go-mysql to keep trailing zero in floats in json #368
Merged
+74
−30
Conversation
This file contains 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
driv3r
reviewed
Nov 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets add a test case with something after decimal, just for completes, i.e. 52.19
mtaner
force-pushed
the
mt/patch-trailing-zero-json-serialisation
branch
from
November 21, 2024 12:56
579d72c
to
41f382c
Compare
mtaner
changed the title
Add config to keep trailing zero & patch
Patch go-mysql to keep trailing zero in floats in json
Nov 21, 2024
driv3r
approved these changes
Nov 25, 2024
vendor/github.com/go-mysql-org/go-mysql/replication/json_binary.go
Outdated
Show resolved
Hide resolved
ilikeorangutans
approved these changes
Nov 25, 2024
Scalvando
reviewed
Nov 25, 2024
Scalvando
approved these changes
Nov 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it!
This was referenced Nov 26, 2024
Closed
mtaner
force-pushed
the
mt/patch-trailing-zero-json-serialisation
branch
from
December 9, 2024 10:26
0783bbd
to
8086a46
Compare
mtaner
force-pushed
the
mt/patch-trailing-zero-json-serialisation
branch
from
December 12, 2024 08:48
8086a46
to
bda3785
Compare
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.
Patched json binary decoder from go-mysql library to add a custom marshal json method for the floats to keep the trailing 0.
This patch only works with mysql version 8, as mysql version 5.7 gets rid of the trailing 0 on
cast...as json
.
This means that the tests added for checking that the trailing 0 is not dropped will fail for the 5.7 ruby tests so I have updated the test to ignore trailing 0 data for mysql version 5.7
Next steps are the open a PR with go-mysql highlighting that this will only work with mysql version 8 onwards (and add settings option similar to
useDecimal
toBinlogSyncerConfig
and see what they think.