Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5.17, 11.0.1, 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11
Description
MariaDB [beta]> select s, lap, avg(s)over() -- , avg(lap)over()
|
-> from (
|
-> select seq s , seq + floor(rand(0)*(2)-1) lap
|
-> from seq_1_to_5
|
-> ) as a
|
-> order by s
|
-> ;
|
+---+-----+--------------+
|
| s | lap | avg(s)over() |
|
+---+-----+--------------+
|
| 0 | 3 | 5.0000 |
|
| 0 | 3 | 5.0000 |
|
| 0 | 5 | 5.0000 |
|
| 0 | 0 | 5.0000 |
|
| 0 | 2 | 5.0000 |
|
+---+-----+--------------+
|
5 rows in set (0.002 sec)
|
Correct result:
+---+-----+----------------+
|
| s | lap | avg(seq)over() |
|
+---+-----+----------------+
|
| 1 | 0 | 3.0000 |
|
| 2 | 2 | 3.0000 |
|
| 3 | 3 | 3.0000 |
|
| 4 | 3 | 3.0000 |
|
| 5 | 5 | 3.0000 |
|
+---+-----+----------------+
|
5 rows in set (0.000 sec)
|