[MCOL-944] coalesce with count(distinct) can lead to incorrect results Created: 2017-09-27 Updated: 2017-10-25 Resolved: 2017-10-25 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.0.11, 1.1.0 |
| Fix Version/s: | 1.0.12, 1.1.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | David Thompson (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Sprint: | 2017-20, 2017-21 |
| Description |
|
to reproduce:
The last column value is -9223372036854775805 instead of 3. Removing the count(distinct) results in the correct result. |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-09-27 ] | |||||||||
|
The very large negative value is almost certainly because null is being interpreted as the internal numeric value for null rather than null. This also behaves similarly with ifnull so doesn't appear to be function related. | |||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-10-02 ] | |||||||||
|
problem appears to be the unsigned int null value is being cast to a signed int and then a decimal so loses the null (since signed and unsigned null are different magic values). | |||||||||
| Comment by Andrew Hutchings (Inactive) [ 2017-10-02 ] | |||||||||
|
The count(DISTINCT) was forcing the aggregation step to use signed BIGINT for an unsigned column which was causing NULL values to not work correctly. Pull requests for 1.0, 1.1 and develop. For QA, this is how it should look:
| |||||||||
| Comment by Daniel Lee (Inactive) [ 2017-10-25 ] | |||||||||
|
Build verified: Github source for 1.1.1-1 /root/columnstore/mariadb-columnstore-server Merge pull request #72 from mariadb-corporation/ /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine removed duplicaue entries Build verified: Github source for 1.0.12-1 /root/columnstore/mariadb-columnstore-server Merge pull request #69 from mariadb-corporation/ /root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine Merge pull request #300 from mariadb-corporation/ Verified with test case in ticket description. |