Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend, net: support connection attrs in COM_CHANGE_USER #367

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

djshow832
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #355

Problem Summary:

  • Connection attributes in COM_CHANGE_USER are not saved, so the connection attrs may be wrong after session migration.

What is changed and how it works:

  • Parse connection attrs in COM_CHANGE_USER, passes it to TiDB (previously not), and sends it to TiDB in the second handshake.
  • After COM_CHANGE_USER, migrate the session if needed. Previously it didn't check the redirection signal after COM_CHANGE_USER.
  • Add comments for why we need another switch-auth request for COM_CHANGE_USER. The reason is here: create and switch user failed on tiproxy #127 (comment)

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Integration test: testBug19354014 in JDBC test.

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot requested a review from bb7133 September 12, 2023 09:41
@ti-chi-bot ti-chi-bot bot added the size/XL label Sep 12, 2023
pkg/proxy/net/mysql_test.go Outdated Show resolved Hide resolved
@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot
Copy link

ti-chi-bot bot commented Sep 12, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-09-12 11:10:49.956131373 +0000 UTC m=+354031.880687766: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot merged commit 8fe7525 into pingcap:main Sep 12, 2023
6 checks passed
@djshow832 djshow832 deleted the conn_attrs branch September 12, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support conn attrs in CHANGE_USER
2 participants