[MDEV-16629] "Table Does Not Exist" Error from Recursive CTE Query Inside Function Created: 2018-06-30 Updated: 2021-04-20 Resolved: 2018-07-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - CTE, Storage Engine - InnoDB, Stored routines |
| Affects Version/s: | 10.3.7 |
| Fix Version/s: | 10.2.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Fred Hornsey | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | cte, function, query | ||
| Environment: |
Ubuntu 18.04 x86_64, MariaDB was downloaded through MariaDB apt repo |
||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Description |
|
I'm trying to wrap a recursive cte query inside a function. The query works outside the function and the function statement itself is accepted without error. When the function is used however it reports that the table I'm trying to query inside the function does not exist. A "use" statement is used before the function definition and specifying the database.table combination does not change the result. Here is the exact error if that is helpful: ERROR 1146 (42S02) at line 33: Table 'ck2.Characters' doesn't exist I've attached the full SQL, but this is a isolated example that has the same problem:
|
| Comments |
| Comment by Alice Sherepa [ 2018-07-02 ] | |||||||||||||||||||||||
|
Thanks for the report! Reproduced on 10.2 commit 8639e288086247ce39917f4cb55191c8bb5b5a8c, 10.3
| |||||||||||||||||||||||
| Comment by Igor Babaev [ 2018-07-21 ] | |||||||||||||||||||||||
|
A fix for this bug was pushed into 10.2 |