-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
vstream: json integers get converted into scientific notation #8686
Comments
@setassociative pointed out that the scientific notation isn't actually invalid, but it presents as an error when unmarshaling to an integer in Go.
Example on the Go playground: https://play.golang.org/p/OAfcfo_Ur2I I found the test cases showing that this is apparently expected behavior. I'm curious what the reasoning was for handling it that way, or if that is just how github.com/spyzhov/ajson handles it. I think we should change the behavior to not use scientific notation. |
The It also looks like there are some flavor-related differences in how json is represented in the binlog or db. I was not able to initially reproduce your errors on 5.7 which is my default mysql version. It does reproduce on 8.0.21. @derekperkins can you please take a look at the tests at vitess/go/mysql/binlog_event_json_test.go Line 27 in 2fcd47d
|
We also hitting this issue, because our original MySQL table uses |
#12761 is the more fundamental fix here which keeps as much as the relevant type information in the JSON document as possible. |
Overview of the Issue
As with other prior json bugs, this appears to be another place where the
copy
vsstream
handles json differently. We are consuming this via vstream / messaging. I believe this error is in thestream
phrase, but works correctly in thecopy
phase, though I'm not 100% sure on the distinction.Original json
{"date": 1629849600, "keywordSourceId": 930701976723823, "keywordSourceVersionId": 210825230433}
Invalid json (though technically still correct)
{"keywordSourceVersionId":2.10825230433e+11,"date":1.6298496e+09,"keywordSourceId":9.30701976723823e+14}
Operating system and Environment details
vtgate: v10.0.2
vttablet: v11.0.0
cc @rohit-nayak-ps
The text was updated successfully, but these errors were encountered: