Repository navigation
branch-4.2: [fix](fe) Backport prepared statement protocol fixes to branch-4.2 - #69463
Merged
Merged
Conversation
### What problem does this PR solve? Related PR: apache#69314 Problem Summary: - COM_STMT_SEND_LONG_DATA incorrectly sends a response and does not bind uploaded chunks, leaving streaming clients out of sync. Accumulate data per statement, defer errors to EXECUTE and clear data after execution or RESET. - Preserve complete parameter types and uploaded values when forwarding prepared execution to the master. Keep branch-4.2's existing expansion of cached types only on the forwarding path, and use the active prepare context during proxy planning. - Empty cursor results can consume their only terminator and hang Connector/J. Advertise an empty cursor and complete FETCH locally, track actual rows, and retain old-FE framing through an optional peer capability. - Release execute payload buffers when the command completes. Adapt protocol state to branch-4.2's existing ConnectContext and ConnectProcessor. Generate regression expectations using branch-4.2's existing VARBINARY function semantics. ### Release note Fix streamed prepared parameters, prepared execution through non-master FEs, and empty cursor fetch hangs. ### Check List (For Author) - Test: Unit Test / Regression test / Manual test - 91 FE unit tests passed; full FE build and Checkstyle passed. - send_long_data and cursor_fetch_empty_result regression suites passed. - Connector/J 8.0.27, 8.0.33, 8.4.0 and 9.7.0 passed master/follower streaming, 50-round batched inserts and empty/nonempty cursor checks against the built FE and BE 4.1.3. - Behavior changed: Yes (correct no-response upload and empty-cursor protocol behavior) - Does this need documentation: No (cherry picked from commit 6fafa31)
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Member
Author
|
run buildall |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
yiguolei
approved these changes
Oct 24, 2026
Contributor
|
skip buildall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Related PR: #69314
Problem Summary:
COM_STMT_SEND_LONG_DATAreturns an unexpected response and does not bind uploaded chunks, leaving streaming clients out of sync. Accept chunks without replying, defer upload errors until EXECUTE, and clear uploaded data after execution or RESET.useCursorFetch=truecan hang or leave unread packets, including when connection attributes are absent or rewritten. Return an empty cursor, complete FETCH withLAST_ROW_SENT, and preserve framing for older FEs through an optional peer capability.Backport adaptations for branch-4.2:
ConnectContext/ConnectProcessorarchitecture and preserve branch-4.2's expansion of cached parameter types only when forwarding.Release note
Fix streamed prepared parameters, repeated prepared execution through non-master FEs, and empty cursor fetch hangs.
Check List (For Author)
Test
prepared_stmt_p0/send_long_dataandprepared_stmt_p0/cursor_fetch_empty_resultpassed withrun-regression-test.sh.run-fe-ut.sh, with zero failures, errors or skips.build.sh --fe; Checkstyle passed with zero violations.Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)