Bug #45860 | significant inaccuracy in decimal multiplication calculations | ||
---|---|---|---|

Submitted: | 30 Jun 2009 16:31 | Modified: | 16 Jan 2013 19:57 |

Reporter: | michael fairbank | Email Updates: | |

Status: | Closed | Impact on me: | |

Category: | MySQL Server | Severity: | S2 (Serious) |

Version: | 5.1.31-1ubuntu2, 5.0, 5.1, 5.4 bzr | OS: | Linux (ubuntu 9.04 64 bit, linux kernel 2.6.28-13-generic) |

Assigned to: | CPU Architecture: | Any | |

Tags: | Decimal accuracy calculations, regression |

[30 Jun 2009 16:31]
michael fairbank

[1 Jul 2009 6:04]
Sveta Smirnova

Thank you for the report. Verified as described.

[1 Jul 2009 6:09]
Sveta Smirnova

Is not repeatable with version 4.1. There is similar bug #36270, but latter is already fixed.

[26 Nov 2012 11:26]
Tor Didriksen

frac is the number of decimal digits after the point For each multiplication in the expression, decimal_mul() does this: to->frac= from1->frac + from2->frac; /* store size in digits */ which will eventually overflow. The code for handling the overflow, will truncate the two digits in "1.75" to "1" It would clearly be better to strip off some of the 72 digits of the other part of the expression.

[16 Jan 2013 19:57]
Paul DuBois

Noted in 5.5.30, 5.6.10, 5.7.1 changelogs. DECIMAL multiplication operations could produce significant inaccuracy.