• Chad MILLER's avatar
    Bug#36270: incorrect calculation result - works in 4.1 but not in 5.0 or 5.1 · 65c3870c
    Chad MILLER authored
    When the fractional part in a multiplication of DECIMALs
    overflowed, we truncated the first operand rather than the
    longest. Now truncating least significant places instead
    for more precise multiplications.
    
    (Queuing at demand of Trudy/Davi.)
    
    mysql-test/r/type_newdecimal.result:
      show that if we need to truncate the scale of an operand, we pick the
      right one (that is, we discard the least significant decimal places)
    mysql-test/t/type_newdecimal.test:
      show that if we need to truncate the scale of an operand, we pick the
      right one (that is, we discard the least significant decimal places)
    strings/decimal.c:
      when needing to disregard fractional parts, pick the least
      significant ones
    65c3870c
decimal.c 85.9 KB