[MDEV-26470] "No database selected" when using CTE in a subquery of DELETE statement Created: 2021-08-24 Updated: 2021-11-29 Resolved: 2021-11-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Delete, Optimizer - CTE |
| Affects Version/s: | 10.6.4, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.2.42, 10.3.33, 10.4.23, 10.5.14, 10.6.6, 10.7.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Lukas Eder | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
The problem can be reproduced as follows
There is an error in the DELETE statement:
Using the syntax in a SELECT statement works as expected:
And so does replacing the CTE by a derived table:
|
| Comments |
| Comment by Oleksandr Byelkin [ 2021-11-22 ] |
|
OK to push |
| Comment by Igor Babaev [ 2021-11-23 ] |
|
A fix for this bug was pushed into 10.2. It must be applied to all higher version. |