morrySnow opened a new pull request, #68077:
URL: https://github.com/apache/doris/pull/68077
### What problem does this PR solve?
Related PR: #67656
Problem Summary:
Backport the fix for `sql_select_limit` being skipped when a CTE is
materialized. `AddDefaultLimit` previously rebuilt `LogicalCTEAnchor` without
visiting its result child, so queries such as two `UNION ALL` branches
referencing the same CTE could return more rows than the session limit allowed.
The result branch is now visited while the CTE producer remains unchanged.
The backport includes the plan-shape unit test and the materialized-CTE
regression case from the source PR.
### Release note
Fix `sql_select_limit` not taking effect for queries using materialized CTEs.
### Check List (For Author)
- Test
- [x] Unit Test
- [x] Regression test coverage included
- Behavior changed:
- [x] Yes. Materialized CTE query results now obey `sql_select_limit`.
- Does this need documentation?
- [x] No.
Test details:
- `AddDefaultLimitTest`: 1 test passed.
- Full FE Maven reactor: `BUILD SUCCESS`.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]