CalvinKirs opened a new pull request, #69314:
URL: https://github.com/apache/doris/pull/69314
### What problem does this PR solve?
Issue Number: N/A
Related PR: #67520, #48689
Problem Summary:
- `COM_STMT_SEND_LONG_DATA` incorrectly returns an error packet, leaving
streaming clients out of sync. Accept parameter chunks without replying, defer
upload errors until EXECUTE, preserve binary bytes, and clear upload state on
EXECUTE/RESET/CLOSE.
- Reusing server-side prepared statements through a non-master FE can fail
with `NoSuchElementException: No value present`: the driver omits unchanged
parameter types, while the master prepares each forwarded execution
independently. Include cached types, the NULL bitmap and complete values in
forwarded EXECUTE payloads.
- Forwarded PREPARE can use a stale statement context when planning
placeholders. Use the parser's current prepare-stage context.
- Empty results with `useCursorFetch=true` can hang or leave unread packets
when client connection attributes are disabled or rewritten. Return a valid
empty cursor, complete FETCH with `LAST_ROW_SENT`, retain cursor state on the
client-facing FE, and preserve existing framing for older FEs. Nonempty results
continue to use buffered delivery; nonempty cursor pagination is not added.
- Normalized streamed values can remain attached to idle pooled connections
after statement close/reset. Release the command-only execution buffer after
response finalization and forwarding complete.
### Release note
- Fix streamed parameters, repeated prepared-statement forwarding and empty
cursor results in the MySQL protocol, and reduce retained parameter-buffer
memory on idle connections.
### Check List (For Author)
- Test:
- [x] Unit Test: 32 focused long-data, protocol adapter and forwarding
tests passed on the final source, including the new buffer-lifecycle test.
- [x] Regression test: `prepared_stmt_p0/send_long_data` and
`prepared_stmt_p0/cursor_fetch_empty_result` passed during implementation.
- [x] Manual test: raw-protocol upload/cursor lifecycle and connection
reuse; rewritten client-attribute proxy reproduction passed after the fix.
- [x] Checkstyle: zero violations in the latest modified Java files.
- Behavior changed:
- [x] Yes. Long-data uploads no longer produce responses; forwarded
parameters are self-contained; empty cursors finish through FETCH; completed
commands release execution buffers.
- Does this need documentation?
- [x] No.
### 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]