Comment 4 for bug 937793

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Turns out, "Log File Size | 2 * 1G = 2.9G" is correct. Here's the comment that's now in shorten():

   # By default Mebibytes (MiB), Gigibytes (GiB), etc. are used because
   # that's what MySQL uses. This may create odd output for values like
   # 1500M * 2 (bug 937793) because the base unit is MiB but the code
   # see 1,572,864,000 * 2 = 3,145,728,000 which is > 1 GiB so it uses
   # GiB as the unit, resulting in 2.9G instead of 3.0G that the user
   # might expect to see. There's no easy way to determine that
   # 3,145,728,000 was actually a multiple of MiB and not some weird GiB
   # value to begin with like 3.145G. The Perl lib Transformers::shorten()
   # uses MiB, GiB, etc. too.