[MDEV-15894] Error, while using aggregated functions/window functions in anchor part Created: 2018-04-17  Updated: 2018-04-24  Resolved: 2018-04-21

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - CTE
Affects Version/s: 10.2
Fix Version/s: 10.2.15

Type: Bug Priority: Major
Reporter: Alice Sherepa Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-15447 Import CTE tests from MySQL 8 Stalled

 Description   

Using aggregated functions/window functions in anchor part (not in a recursive part)-is allowed in Mysql, Mariadb returns error 4008: Restrictions imposed on recursive definitions are violated for table

create table t1(b int);
insert into t1 values(10),(20),(10);
 
with recursive qn as
  (select max(b) as a from t1 union
   select a from qn)
select * from qn;
 
with recursive qn as
  (select rank() over (order by b) as a from t1 union
   select a from qn)
select * from qn;



 Comments   
Comment by Igor Babaev [ 2018-04-21 ]

A fix for this bug was pushed into 10.2

Generated at Thu Feb 08 08:24:49 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.