[MCOL-335] Many Window Functions erroniously return 0 Created: 2016-09-27 Updated: 2016-10-06 Resolved: 2016-10-06 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | PrimProc |
| Affects Version/s: | 1.0.3 |
| Fix Version/s: | 1.0.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS |
||
| Sprint: | 2016-19 |
| Description |
|
Starting with 1.0.3, many of the Windowing Functions return 0 rather than the proper answer. Investigation implicates the the merge with server 10.1.15, though it is possible that another merge caused it. Example (1.0.2) ------------
------------
------------ example (1.0.3) ------------
------------
------------ |
| Comments |
| Comment by Andrew Hutchings (Inactive) [ 2016-09-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Confirmed that this broke with the merge of 10.1.16 (the 10.1.15 merge is fine). There were some changes around create_tmp_field() in this version which did cause conflicts that I thought I resolved correctly. That would be my first target to look at. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Hutchings (Inactive) [ 2016-09-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
So, the cause is as follows: In 10.1.16 there was a consolidation of temporary field creation functions inside sql_select.cc. Previously when item_func created a temporary field it used result_type() in the switch to determine the type to use (which results in DECIMAL for the above query). The consolidated version uses cmp_type() instead (which results in DOUBLE for the above query). For the fix I'm going to use a ternary operator to determine whether or not this is a window function and use the correct type accordingly. | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2016-10-06 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Build verified: 1.0.4-1 mcsadmin> getsoft Name : mariadb-columnstore-platform MariaDB [tpch1c]> select n_nationkey, avg(n_nationkey) over(order by n_nationkey range between unbounded preceding and 15 following) a from nation;
------------
------------ |