
Type: Bug

Status: Closed (View Workflow)

Priority: Major

Resolution: Duplicate

Affects Version/s: 10.2, 10.3, 10.4

Fix Version/s: N/A

Component/s: Optimizer  Window functions

Labels:None
create table t1(i int); 
insert into t1 values (1),(2),(3),(4),(5); 

select sum(i) over (order by sum(i)) from t1 group by i; 
select sum(i) over (order by sum(i)+1) from t1 group by i; 
MariaDB [test]> select sum(i) over (order by sum(i)) from t1 group by i;

++

 sum(i) over (order by sum(i)) 

++

 1 

 3 

 6 

 10 

 15 

++

5 rows in set (0.002 sec)


MariaDB [test]> select sum(i) over (order by sum(i)+1) from t1 group by i;

++

 sum(i) over (order by sum(i)+1) 

++

 15 

 15 

 15 

 15 

 15 

++

5 rows in set (0.001 sec)


Mysql 8.0.15:
mysql> select sum(i) over (order by sum(i)) from t1 group by i;

++

 sum(i) over (order by sum(i)) 

++

 1 

 3 

 6 

 10 

 15 

++

5 rows in set (0.00 sec)


mysql> select sum(i) over (order by sum(i)+1) from t1 group by i;

++

 sum(i) over (order by sum(i)+1) 

++

 1 

 3 

 6 

 10 

 15 

++

5 rows in set (0.00 sec)

 duplicates

MDEV14791 Crash with order by expression containing window functions
 Closed