morrySnow opened a new pull request, #67780:
URL: https://github.com/apache/doris/pull/67780
### What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary:
MV pre-rewrite normalizes CTE children before the main rewrite. It reused
the main statement context, allowing temporary CTE producer and consumer caches
to affect later privilege checking and leaving partial CTE maps that could fail
with an internal error.
This change gives temporary pre-rewrite its own mutable statement state
while keeping ID and generated-alias allocation in the original statement
scope. It temporarily installs the isolated context for utilities that access
the connection directly and restores the original context in a `finally` block.
The regression test creates a view for which a user can select one column
but not another, then exercises direct access and CTE queries under both
default and forced pre-rewrite strategies. All paths must return the same
permission error.
### Release note
None
### Check List (For Author)
- Test:
- [x] Regression test
- [x] Unit Test
- [x] Manual test
- Behavior changed:
- [x] Yes. MV pre-rewrite can no longer bypass or replace view-column
privilege errors.
- Does this need documentation?
- [x] No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]