vitvara opened a new pull request, #69899:
URL: https://github.com/apache/doris/pull/69899

   ### What problem does this PR solve?
   
   Issue Number: None
   
   Related PR: #68795
   
   Problem Summary:
   
   Cherry-picked from #68795. A row policy with a user variable in `USING` 
(e.g. `restaurant_id = @authorized_restaurant`) makes `SHOW ROW POLICY` fail 
with `Invalid call to sql on unbound object`. The fix implements 
`UnboundVariable#computeToSql`.
   
   We ran into this issue in production on 4.1.3. We can't list our row 
policies, which makes managing them pretty difficult. Hopefully we can get this 
fix into the next 4.1 release.
   
   `RowPolicyFilterSqlTest.java` changes are left out because that test does 
not exist on branch-4.1.
   
   ### Release note
   
   Fix `SHOW ROW POLICY` failing when a row policy's `USING` clause references 
a user variable.
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [x] Regression test
       - [x] Unit Test
       - [x] Manual test (add detailed scripts or steps below)
           - On 4.1.4: `SHOW ROW POLICY` fails on the official FE and works on 
the FE built with this fix.
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->


-- 
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]

Reply via email to