ajson icon indicating copy to clipboard operation
ajson copied to clipboard

Inconsistency in data types during decoding/encoding

Open lisachenko-indriver opened this issue 1 year ago • 3 comments

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

lisachenko-indriver avatar Mar 14 '23 12:03 lisachenko-indriver

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.

spyzhov avatar Mar 14 '23 21:03 spyzhov

@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.

spyzhov avatar Mar 17 '23 11:03 spyzhov

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.

rohit-nayak-ps avatar Mar 17 '23 13:03 rohit-nayak-ps