[MDEV-17154] Multiple selects from parametrized CTE fails with syntax error Created: 2018-09-07 Updated: 2020-04-04 Resolved: 2018-09-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE |
| Affects Version/s: | 10.2.17, 10.3.9, 10.2, 10.3 |
| Fix Version/s: | 10.2.18 |
| Type: | Bug | Priority: | Major |
| Reporter: | Johan Björk | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
The following query works fine:
When extracting the "1" into a parameter the query fails with error 1064:
Tested on OSX 10.13.6. MySQL 8 seems to handle this without trouble. |
| Comments |
| Comment by Alice Sherepa [ 2018-09-07 ] | |||||||
|
Thanks for the report! Reproduced as described, if cte is used minimum twice in the prepared (in join, union, intersect/except), then the error is returned
| |||||||
| Comment by Oleksandr Byelkin [ 2018-09-14 ] | |||||||
|
ok to push | |||||||
| Comment by Igor Babaev [ 2018-09-15 ] | |||||||
|
A similar problem with local variables of SP can be seen here:
| |||||||
| Comment by Igor Babaev [ 2018-09-16 ] | |||||||
|
A fix for this bug was pushed into 10.2. |