[MDEV-17256] Decimal field multiplication bug Created: 2018-09-20 Updated: 2018-10-31 Resolved: 2018-10-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, Server |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.1.36, 10.3.9, 10.2, 10.3 |
| Fix Version/s: | 10.3.11, 10.1.37, 10.2.19, 5.5.63, 10.0.38 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Tom Dangler | Assignee: | Alexey Botchkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Environment: |
Linux mariadb-10-3-devel 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux |
||
| Description |
|
I'm having a problem when multiplying decimal fields together. I have included the table schema and data below. When I multiply all of these fields together in 1 order, I get a different result than when I multiply them in a different order. I would think that multiplying them in any order would produce the same result, but it clearly does not. Can anyone shed some light on this? Behavior exists in MariaDB 10.1.36 and MariaDB 10.3.9 ( I have not tested MariaDB 10.2). I tested this in MySQL 5.7, and both queries in 5.7 produce the same (correct) result. *UPDATE - I think this might be related to MySQL Bug #45860. I tested and confirmed that the bug existed in 5.1, but not 5.5, 5.6, or 5.7.*
|
| Comments |
| Comment by Elena Stepanova [ 2018-09-21 ] | ||||||||||||||||||||||||||||||||||||||
|
Thanks for the report. Reproducible as described.
| ||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2018-09-21 ] | ||||||||||||||||||||||||||||||||||||||
|
This query also produces a wrong result
Notice, calc1 and calc2 erroneously return the same value. The multiplication to F21 did not happen for some reason in calc2. | ||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2018-09-21 ] | ||||||||||||||||||||||||||||||||||||||
|
So does this:
| ||||||||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2018-09-21 ] | ||||||||||||||||||||||||||||||||||||||
|
The problem happens inside decimal_mul(). FIX_INTG_FRAC_ERROR() returns error=1 at some point. Thanks. | ||||||||||||||||||||||||||||||||||||||
| Comment by Tom Dangler [ 2018-10-03 ] | ||||||||||||||||||||||||||||||||||||||
|
Do we have an ETA on a fix for this issue? I have a project on hold pending the resolution of this. | ||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2018-10-16 ] | ||||||||||||||||||||||||||||||||||||||
|
Yes, the plan is to have it fixed in 10.1.37. | ||||||||||||||||||||||||||||||||||||||
| Comment by Tom Dangler [ 2018-10-16 ] | ||||||||||||||||||||||||||||||||||||||
|
Ok - thank you for the update. | ||||||||||||||||||||||||||||||||||||||
| Comment by Alexey Botchkov [ 2018-10-23 ] | ||||||||||||||||||||||||||||||||||||||
|
http://lists.askmonty.org/pipermail/commits/2018-October/013037.html |