conduitio-labs / conduit-connector-mysql

Conduit connector for MySQL
1 stars 1 forks source link

Bug: possible precision loss when encoding snapshot positions #25

Closed alarbada closed 1 week ago

alarbada commented 3 months ago

Bug description

The json.Marshal calls can loose precision when encoding 64 bit integers.

Steps to reproduce

  1. Add test case with max uint64 value snapshot key / source position.
  2. Marshal it
  3. Compare expected vs actual

Version

v0.1.0

alarbada commented 3 months ago

So, we would loose precision in the case that the primary key would be a big unsigned integer, or if any column has that type of data. I might be able to do something with FormatValue.

alarbada commented 1 week ago

Closing this. I confused the issue, it is not really a problem, as we will marshal and unmarshal positions inside go code. The rounding errors would happen if the consumer of those positions was javascript.