Skip to content

fix(frontend): silence missing binary statement closes - #31413

Merged
XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/fix-27338-stmt-close
Oct 28, 2026
Merged

XuPeng-SH merged 7 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/fix-27338-stmt-close

Conversation

@jiangxinmeng1

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #27338

What this PR does / why we need it:

The MySQL protocol sends no response to binary COM_STMT_CLOSE, so clients do not read one. MatrixOne sent an ERR packet when the statement ID was already absent, leaving that packet to be consumed by the next command and desynchronizing the connection.

For a valid close packet, silently accept an absent handle and suppress a response if internal deallocation fails. Keep the existing cursor and parameter cleanup for known handles, preserve ROW_COUNT() and diagnostics, and leave text SQL DEALLOCATE PREPARE behavior unchanged. Truncated close packets retain the existing protocol-error behavior tracked by #25744.

Validation: focused frontend unit and real MySQL wire tests for unknown close, known close, repeated close, and the following PING; full pkg/frontend tests. CI pending.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added size/M Denotes a PR that changes [100,499] lines and removed size/S Denotes a PR that changes [10,99] lines labels Oct 28, 2026
@XuPeng-SH

XuPeng-SH commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: c504f256b0f6b5a8a72ab02ec2f7f5b1f585ece1

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: c504f256b0f6b5a8a72ab02ec2f7f5b1f585ece1

Assessment: approve

The change restores response-free binary COM_STMT_CLOSE handling for missing handles and returned deallocation errors, while preserving existing cleanup, ROW_COUNT, text DEALLOCATE and malformed-packet behavior. No actionable findings remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Reviewed the complete three-file delta, response and cleanup owners, full PR discussion and both linked issues. Saved discussion-assessment.json; no substantive prior findings or rebuttals remain.

  • Reviewed missing-handle and injected-error tests, plus the frontend packet-loop regression covering unknown, known and repeated closes followed by PING. Reused frozen exact-head successful UT, coverage, build and BVT statuses; checked frontend test selection in source.

  • Local static audit passed. Receipt checks/1793161672149965549-6.json, input-audit.log and validation-audit.json agree on command, clean source and exit 0.

Limitations:

  • No local Go tests were rerun. Detailed CI logs and author local-test receipts were not supplied; individual runtime results beyond the frozen CI statuses are not claimed.

  • The wire regression exercises the real frontend over net.Pipe with mocked storage and transaction dependencies, rather than a deployed cluster or Python driver.

@mergify mergify Bot added the queued label Oct 28, 2026
@mergify

mergify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

1 h 11 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Wed 28 Oct, 04:29 · rule main · triggered by rule Automatic queue on approval for main
  • ⏹️ Testing stopped · in place
  • 🚫 Left the queue 05:40 · 2e063c7

Reason

Pull request #31413 has been dequeued

Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.

The author needs to enable "Allow edits from maintainers" on this pull request.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

Merge conditions: 2 of 3 met

This pull request

Condition Required by
✅ #review-threads-unresolved = 0 GitHub branch protection
✅ github-review-approved GitHub branch protection

The batch, tested in place

Condition Required by
❌ any of: check-neutral = CI Required, check-skipped = CI Required, check-success = CI Required GitHub branch protection

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dequeued kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: COM_STMT_CLOSE on an absent statement sends a response and desynchronizes the next command

4 participants