[MCOL-4738] AVG returns a wrong result Created: 2021-05-28 Updated: 2021-07-09 Resolved: 2021-07-09 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 6.1.1 |
| Fix Version/s: | 6.1.1 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Alexander Barkov | Assignee: | Gagan Goel (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Sprint: | 2021-8, 2021-9 |
| Description |
|
This problem is not repeatable with the develop-5 branch. This problem is repeatable with the develop branch on Fedora (5.5.9-200.fc31.x86_64), only with RelWithDebInfo build. I run this script:
Looks good so far.
Looks wrong.
Also looks wrong. If I change ENGINE to InnoDB, it returns expected results:
|
| Comments |
| Comment by David Hall (Inactive) [ 2021-06-30 ] | ||||||||||||||
|
AMD64 machines use 80 bits for long double, but (as a default) store the values in 128 bits. After much testing, I've determined that gcc does not fill these unused bits, but rather leaves them undisturbed. Since we may compare rows using memcmp, any uninitialized bits such as this will compromise the compare. So we need to mask these bits to something so that memcmp works. In order to work for systems (such as ARM) that use 128 bit long doubles rather than 80- bit, we can use
To determine if masking is needed. | ||||||||||||||
| Comment by David Hall (Inactive) [ 2021-07-07 ] | ||||||||||||||
|
Put logic in cmake to test for an 80 bit fpu and set a compiler flag. Then added an ifdef into setLongDoubleField to mask out the unused bits. | ||||||||||||||
| Comment by Roman [ 2021-07-07 ] | ||||||||||||||
|
I am not sure if it is possible to test this w/o developer ATM. The patch affects ARM or custom builds on either Fedora(we don't have it in our CI) | ||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2021-07-07 ] | ||||||||||||||
|
David.Hall, drrtuy The patch still does not fix Ninja RelWithDebInfo builds. I am re-opening the ticket:
| ||||||||||||||
| Comment by Alexander Barkov [ 2021-07-07 ] | ||||||||||||||
|
The patch does not fix the problem on my Fedora box. | ||||||||||||||
| Comment by David Hall (Inactive) [ 2021-07-07 ] | ||||||||||||||
|
I came up with a solution that should work wit strict_aliasing | ||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2021-07-08 ] | ||||||||||||||
|
Changes look good to me. I have confirmed Ninja RelWithDebInfo builds are now giving expected results. bar Can you please confirm if the problem is also now fixed in your Fedora box? | ||||||||||||||
| Comment by Gagan Goel (Inactive) [ 2021-07-09 ] | ||||||||||||||
|
Bar confirmed the issue is also fixed on Fedora. Closing this as fixed. |