pt-table-checksum's --float-precision does not work for very small / large values
we use pt-table-checksum for a fairly large database containing measured values stored as DOUBLE. For very large or small values the ROUND() MySQL function used by --float-precision does not work as expected.
E.g. on the master it maps very small values to "0.0", while on the slave it maps them to "-0.0" (resulting in a different crc32). Or for large values, e.g. on the master and slave the significant digits of the mantissa are different after ROUND().
We have a patch that introduces a new command-line option to activate a different rounding algorithm that solves both problems. However, it is slower than the simple ROUND(), for that reason and backwards-
IF($result = 0, 0, SIGN($result) * ROUND(LOG2(
Would you be willing to accept such a patch in general? On which branch should it be based? If there is a chance to get it integrated upstream, we can provide concrete examples and further explanation.
Johannes Weißl and Sebastian Egner