[MCOL-3839] Count as a window function doesn't work with NULLs Created: 2020-02-25 Updated: 2020-11-12 Resolved: 2020-05-06 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.2.5 |
| Fix Version/s: | 1.4.4, 1.5.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Patrick Safarov | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Sprint: | 2020-4, 2020-5, 2020-6, 2020-7 |
| Epic/Theme: | 1.4_regressions |
| Description |
|
If we use an expression as a `count ` argument, it counts all rows including the ones containing NULLs |
| Comments |
| Comment by David Hall (Inactive) [ 2020-03-02 ] | ||||||
|
One may be tempted to ask why anyone would write count(NULL). Automated systems do. | ||||||
| Comment by David Hall (Inactive) [ 2020-04-24 ] | ||||||
|
Looking at colIn == -1 to check for NULL has the incorrect assumption that the -1 is caused by a NULL parameter. What is actually happening is that because the parameter is a constant, the field index is -1. Any constant will do this. | ||||||
| Comment by Jose Rojas (Inactive) [ 2020-04-24 ] | ||||||
|
I have updated change to work for other constants as well as NULLs. | ||||||
| Comment by Daniel Lee (Inactive) [ 2020-05-06 ] | ||||||
|
Build verified: 1.4.4-1m 1.5.0-1 source 1.4.4-1 /root/ColumnStore/buildColumnstoreFromGithubSource/server /root/ColumnStore/buildColumnstoreFromGithubSource/server/engine Merge pull request #1179 from pleblanc1976/update-libs3-ref Updated the s3 lib. 1.5.0-1 /root/ColumnStore/buildColumnstoreFromGithubSource/server /root/ColumnStore/buildColumnstoreFromGithubSource/server/engine Date: Tue May 5 12:35:14 2020 -0500 Merge pull request #1178 from pleblanc1976/update-libs3-ref-1.5 Updated s3 lib ref Reproduced the issue in 1.2.5-1 MariaDB [mytest]> select count(null) over () from orders where o_orderdate > '1997-05-17' - interval 1 hour; MariaDB [mytest]> select count(null) over () from orders where o_orderdate > '1998-08-02' - interval 1 hour;
---------------------
.
--------------------- MariaDB [mytest]> select count
----------
---------- |