Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.0.3
-
None
-
CentOS
-
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)
MariaDB [tpch1]> select n_nationkey, avg(n_nationkey) over(order by n_nationkey range between unbounded preceding and 15 following) a from nation;
--------------------+
n_nationkey | a |
--------------------+
0 | 7.5000 |
1 | 8.0000 |
2 | 8.5000 |
3 | 9.0000 |
4 | 9.5000 |
5 | 10.0000 |
6 | 10.5000 |
7 | 11.0000 |
8 | 11.5000 |
9 | 12.0000 |
10 | 12.0000 |
11 | 12.0000 |
12 | 12.0000 |
13 | 12.0000 |
14 | 12.0000 |
15 | 12.0000 |
16 | 12.0000 |
17 | 12.0000 |
18 | 12.0000 |
19 | 12.0000 |
20 | 12.0000 |
21 | 12.0000 |
22 | 12.0000 |
23 | 12.0000 |
24 | 12.0000 |
--------------------+
example (1.0.3)
MariaDB [tpch1]> select n_nationkey, avg(n_nationkey) over(order by n_nationkey range between unbounded preceding and 15 following) a from nation;
-------------------+
n_nationkey | a |
-------------------+
0 | 0.0000 |
1 | 0.0000 |
2 | 0.0000 |
3 | 0.0000 |
4 | 0.0000 |
5 | 0.0000 |
6 | 0.0000 |
7 | 0.0000 |
8 | 0.0000 |
9 | 0.0000 |
10 | 0.0000 |
11 | 0.0000 |
12 | 0.0000 |
13 | 0.0000 |
14 | 0.0000 |
15 | 0.0000 |
16 | 0.0000 |
17 | 0.0000 |
18 | 0.0000 |
19 | 0.0000 |
20 | 0.0000 |
21 | 0.0000 |
22 | 0.0000 |
23 | 0.0000 |
24 | 0.0000 |
-------------------+