[MDEV-25007] Clarify the use of unqualified function names in view definitions Created: 2021-02-27 Updated: 2021-03-01 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Views |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Both MySQL manual and MariaDB KB describe (in identical words) how unqualified table and view names are resolved within CREATE VIEW statement:
However, neither explains what happens with unqualified function names, and it is not obvious, as it apparently works differently from table and view names:
So, it actually uses the function from the same schema where the view resides, not from the default schema. It works the same way in all MariaDB and MySQL versions, so I hope it's intentional and just needs to be documented. |
| Comments |
| Comment by Sergei Golubchik [ 2021-03-01 ] | ||||||||||||||||
|
I don't think it's intentional. Compare with columns
This, as you wrote, returns
And the view definition is
I think it's an oversight that tables stored are db-qualified, while functions aren't. It's inconsistent. |