ajson
ajson copied to clipboard
Inconsistency in data types during decoding/encoding
Vitess uses this library for encoding/decoding data from JSON columns during replication of data. We have faced an issue with data consistency between our original database and data, which was replicated via Vitess. Surprisingly, issue originated from this library.
See relevant issues and PRs in Vitess to find more details:
https://github.com/vitessio/vitess/issues/8686 https://github.com/vitessio/vitess/pull/9508
I think this can be also fixed in you library to avoid issues with type switching in the feature. See this fork from @rohit-nayak-ps which has adressed this https://github.com/spyzhov/ajson/compare/master...rohit-nayak-ps:ajson:master
Thanks for sharing! Will check the fork and try to migrate it to the library.
Also, be aware that I just closed bug #61, please do not forget to update the fork.
@rohit-nayak-ps, I saw you'd created a new branch https://github.com/spyzhov/ajson/compare/master...rohit-nayak-ps:ajson:vitess-integer-types will you prepare a PR for those changes? I can fix most of the underlying dependencies (in the math mostly) to do new types compatible with the Numeric
type.
Thanks for checking. We found a separate issue with MySQL JSON datatypes for arbitrary precision numeric/decimal data. I have a fix in progress for that. I will create a PR including that as well.