HappenLee opened a new pull request, #65004: URL: https://github.com/apache/doris/pull/65004
### What problem does this PR solve? When a sorted-run merge cursor reaches the end of its current block and the sender already has the next block ready, the merger may fetch the next block before flushing rows that have already been selected into the output block. For variable-length columns, the pending row addresses still point to the previous cursor block. Reusing the cursor block before `do_insert()` can make the output read rows from the wrong block and corrupt string offsets. ### What is changed? Flush pending output rows before loading the next ready block from the exhausted cursor. This keeps the existing non-ready path behavior unchanged: when the next block is not ready, the cursor is saved as pending and the current output block is returned first. The PR also adds regression coverage for both: - continuing merge when the next sender block is already ready - preserving string column values before the cursor block is reused ### Check List - [x] `./run-be-ut.sh -j 48 --run --filter=SortMergerTest.*` -- 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]
