Repository navigation
fix(frontend): apply negotiated session collation - #30398
mergify[bot] merged 9 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Reviewed latest head No blocking findings in this change. The negotiated values are applied after account-global initialization during authentication; Validation performed on this head in an isolated worktree:
Non-blocking suggestion: promote the authenticated TCP checks and the cross-charset change-user/dirty-reset scenario into permanent tests. The current change-user regression always uses the same default collation, so it would not detect accidentally retaining the previous negotiated pair. Code-review recommendation: approve, subject to required CI passing. CI was still pending/running at review time; I did not run the entire frontend/integration suite. This is an ordinary review comment, not a formal approval. |
|
Updated PR #30398 to head
|
|
再次更新到
新的 Required CI 已重新触发,请基于该 head 重新 review。 |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed ae4c92965d08efddd5d5db19571754851c980692 against aa4b6eddfdad54d11be6fd75a5675eb9801f6690 (all six changed files, implementation +50/-4, tests/golden +87/-6, no documentation delta).
No blocking finding. The fix belongs at the existing authentication/reset publication boundary: initialize from account globals, then apply the admitted connection identity. COM_CHANGE_USER shares canonical authentication; reset applies to the unpublished candidate before retiring the old generation. Existing candidate rejection cleanup restores the old protocol/session; the outer wire handler intentionally disconnects after failed COM_CHANGE_USER. No duplicate registry, state machine or per-query work; the superseded reset wrapper was removed.
Supplemental reviewer validation on this exact head: actual authenticated TCP SQL connections for utf8mb4_general_ci, utf8_unicode_ci and utf8mb4_unicode_ci, asserting all four variables immediately after login and unchanged after an invalid SET NAMES pair. A separate real wire-loop probe exercises cross-charset COM_CHANGE_USER (192/224), dirty session collation, COM_RESET_CONNECTION, physical-connection reuse twice, followed by an unsupported collation ERR and disconnect. Both final probes passed: authenticated SQL root 4.53s (package 6.195s), wire root <0.01s (package 1.143s), Go 1.27.1/darwin-arm64. The wire fixture skips credential checking, so authenticated initialization is covered separately by the TCP probe.
Reused exact-head successful CI run 38994096430 for UT, SCA, coverage, build and BVT, plus the green Connector/J reset E2E. All prior conversation notes were checked; there are no unresolved review threads. Recommend retaining the cross-charset wire regression in the repository as follow-up test coverage.
Performance boundary: four setters/validation at login/change/reset; no changed SQL execution hot path. No claim of zero extra reset CPU or a measured TP benchmark. Typed migration preserves these negotiated values; pre-v22 targets remain subject to existing fail-closed replayability checks.
Validation notes: the initial raw go-test command failed at dynamic loading before any test; the repository CGo wrapper resolved that. The first wire probe incorrectly expected reuse after rejected COM_CHANGE_USER, contradicted by the unchanged disconnect contract; the corrected probe checks ERR/disconnect last and passes. Authenticated SQL passed in the earlier combined run; that combined command exited 1 solely for the incorrect wire oracle. No product source was changed.
Merge Queue Status
This pull request spent 2 hours 43 minutes 38 seconds in the queue, including 51 minutes 57 seconds running CI. Required conditions to merge
|
|
本轮独立功能验证(2026-10-17,冻结 main
结论:#30398 修复的 main 会话初始化/重置范围已验证,按约定转给 @Ariznawlll。该结论针对本 issue 的会话状态;#25096/#28164 的 general_ci 比较/UNIQUE,以及 #30339/#30340 的诊断/级联问题在本轮 main 仍复现,分别继续由原 issue 跟踪。 |
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30395
What this PR does / why we need it:
The MySQL handshake negotiated a charset/collation in protocol state, but the newly authenticated session retained
collation_connection = 'default'and the default connection charset variables. This was also lost afterCOM_RESET_CONNECTIONrebuilt a session from account-global defaults.This change applies the admitted protocol charset/collation to
character_set_client,character_set_connection,character_set_results, andcollation_connectionfor initial authentication,COM_CHANGE_USER, andCOM_RESET_CONNECTION. Reset uses a candidate-session hook before the old generation is retired, so a failed application does not publish the candidate. The wire regressions cover a non-defaultutf8mb4_unicode_cihandshake, repeated reset, and change-user behavior.Validation: