[MDEV-31657] Crash on query using CTE with the same name as a base table Created: 2023-07-10 Updated: 2024-01-04 Resolved: 2024-01-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE, Server |
| Affects Version/s: | 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 10.9.7 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Jacob Williams | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux |
||
| Description |
|
The following sql reproduces the issue. The create table is not really needed since it doesn't get that far. It crashes before it knows whether the table exists. It seems that it works ok if the last cte is used as the main query instead. So it has something to do with one cte having two references to the previous cte and the previous cte selecting from a table with the same name as itself.
When it crashes there are no messages in the error log, the server just dies. |
| Comments |
| Comment by Alice Sherepa [ 2023-07-11 ] | ||
|
Thanks for the report!
| ||
| Comment by Igor Babaev [ 2024-01-03 ] | ||
|
@sanja, please review. See also bb-10.4-mdev-31657. | ||
| Comment by Oleksandr Byelkin [ 2024-01-03 ] | ||
|
OK to push | ||
| Comment by Igor Babaev [ 2024-01-04 ] | ||
|
A fix for this bug was pushed into 10.4. It has to be merged upstream as it is. |