[MDEV-8407] Numeric errors, server crash with COLUMN_JSON() on DECIMAL with precision > 40 Created: 2015-07-01 Updated: 2015-12-10 Resolved: 2015-12-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Dynamic Columns |
| Affects Version/s: | 10.0, 10.1 |
| Fix Version/s: | 5.5.48, 10.0.23, 10.1.10 |
| Type: | Bug | Priority: | Major |
| Reporter: | Tom | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Darwin yossy.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 |
||
| Sprint: | 10.0.23 |
| Description |
|
Lines 4 through 11 of the following input have numeric errors in the JSON output. Line 12 crashes the server.
Lines 6 through 13 of the following input have numeric errors in the JSON output. Line 14 crashes the server.
Note 1: JSON supports decimal number with arbitrary precision and scale. Note 2: Apart from being numerically wrong, lines 6 through 13 of the output in the second test |
| Comments |
| Comment by Elena Stepanova [ 2015-07-01 ] | |||||||||||||||||||||||
|
Thanks for the report. The truncated values might be due to the limitation on the scale (30 digits for DECIMAL); although, I'd expect there should be a warning somewhere – either on adding the value or on retrieving it. I'll leave it to sanja to decide what would be the right behavior. The crash is definitely a bug. ATTN sanja: Here is the stack trace from this build http://buildbot.askmonty.org/buildbot/builders/kvm-bintar-centos5-amd64/builds/1545 (the latest 10.0 as of now).
| |||||||||||||||||||||||
| Comment by Tom [ 2015-07-01 ] | |||||||||||||||||||||||
|
COLUMN_CREATE and COLUMN_GET cope with 65 digits of precision, as default MySQL DECIMALS do. That's why I suspect this lies closer to the JSON part.
| |||||||||||||||||||||||
| Comment by Elena Stepanova [ 2015-07-01 ] | |||||||||||||||||||||||
|
I was referring to the first set of lines in the description.
Sorry I missed the second set of lines before. Yes, I agree, it looks erroneous to me as well, and explicit AS in COLUMN_CREATE does not solve it either.
| |||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2015-12-09 ] | |||||||||||||||||||||||
|
ok to push | |||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2015-12-10 ] | |||||||||||||||||||||||
|
fixed in 5.5:
In fact it was error in decimal library (incorrect processing of buffer overflow) invisible from other server parts because of buffer allocation and precision tests. — |