[MDEV-20751] Permission Issue With Nested CTEs Created: 2019-10-04 Updated: 2020-12-18 Resolved: 2020-12-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System, Optimizer - CTE |
| Affects Version/s: | 10.4.8, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.2.37, 10.3.28, 10.4.18, 10.5.9 |
| Type: | Bug | Priority: | Major |
| Reporter: | Kevin Andrews | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
CentOS 7 |
||
| Description |
|
Queries with CTEs referencing other CTEs eventually cause permission denied errors on users with SELECT permissions on specific list of tables. Issue is also present when using the newer roles based permissions. Setups to reproduce:
We've started relying on CTEs for anyone writing custom reports as an easy way to pick up and use existing query partials defined for our data sets. Significantly reduces the learning curve and makes reusing SQL code easier for our data team. However there is no way we can give users SELECT privilages on the entire schema, per table is a requirement here. Happy to help further diagnose. |
| Comments |
| Comment by Alice Sherepa [ 2019-10-04 ] | ||||||||||||||||||||||
|
Thanks for the report!
| ||||||||||||||||||||||
| Comment by Kevin Andrews [ 2019-10-04 ] | ||||||||||||||||||||||
|
Not a problem, interesting to see it replicated with just one table... much better example! Thanks for putting that together, mine was based off a live query which needed a lot of debugging and simplification to get down to what I reported. I'm glad it's replicated your side as well, makes things easier to track down. | ||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2020-12-17 ] | ||||||||||||||||||||||
|
OK to push after fixing what we have discussed | ||||||||||||||||||||||
| Comment by Igor Babaev [ 2020-12-18 ] | ||||||||||||||||||||||
|
A fix for this bug was pushed into 10.2 |