[MDEV-19337] CTEs not working with outer references Created: 2019-04-25 Updated: 2023-02-28 Resolved: 2019-04-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE |
| Affects Version/s: | 10.4.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jonas Staudenmeir | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 18.04.1 |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Common table expressions don't work with outer references. Consider a recursive parent-child relationship between users:
This query selects all users with more than 10 descendants:
The query fails with an error:
The query works on MySQL 8 (since 8.0.14), PostgreSQL, SQLite and SQL Server. |
| Comments |
| Comment by Alice Sherepa [ 2019-04-26 ] |
|
Currently, Mariadb does not allow outer references in derived tables and CTE. If you'd like to follow the progress, please, watch task MDEV-19078 |