[MCOL-3423] Wrong results for complex query with subquery and window functions over decimal(12,4) column Created: 2019-08-12 Updated: 2020-04-10 Resolved: 2019-11-13 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | None |
| Affects Version/s: | 1.2.3, 1.2.5 |
| Fix Version/s: | 1.2.6 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Valerii Kravchuk | Assignee: | Bharath Bokka (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | decimal, window-functions | ||
| Attachments: |
|
| Sprint: | 2019-06 |
| Description |
|
Consider the fol,lowing tables (dump of InnoDB table t will be attached):
They have the same data based on SELECTs above. Now let me apply a bit complex SELECT with window functions and subqueries:
You can see that the values for Columnstore table tc are different (and wrong) in some columns. |
| Comments |
| Comment by Bharath Bokka (Inactive) [ 2019-11-13 ] | ||||||||||||||||||||||||||||
|
Build tested- [bbokka@cs-tst-02 centos7]$ cat gitversionInfo.txt Complex SELECT with window functions and subqueries as per the description works fine. Ex: Followed same steps as per the description. MariaDB [test]> select cust, week_d, mpp_sum , stddev(mpp_sum) over (partition by cust) as mpp_stdev , avg(mpp_sum) over (partition by cust) as mpp_mean , sum(mpp_sum) over (partition by cust) as glob_mpp_sum, count(mpp_sum) over (partition by cust) as glob_mpp_count from (select distinct cid as cust, week(d) as week_d , sum(c) over (partition by cid, week(d)) as mpp_sum from t where year(d) = '2018') as inside where cust = 0 and week_d = 0;
-----
----- MariaDB [test]> select cust, week_d, mpp_sum , stddev(mpp_sum) over (partition by cust) as mpp_stdev , avg(mpp_sum) over (partition by cust) as mpp_mean , sum(mpp_sum) over (partition by cust) as glob_mpp_sum, count(mpp_sum) over (partition by cust) as glob_mpp_count from (select distinct cid as cust, week(d) as week_d , sum(c) over (partition by cid, week(d)) as mpp_sum from tc where year(d) = '2018') as inside where cust = 0 and week_d = 0;
-----
----- The SELECT query gave the same output for both InnoDB and Columstore engines. Closing the bug. |