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: fix using password in the error message is wrong #333

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Jul 19, 2023

What problem does this PR solve?

Issue Number: close #332

Problem Summary:
When TiProxy handshakes with TiDB, it sends auth_plugin=unknown_auth_plugin and auth_data=nil. TiDB sees that auth_data=nil and then sets using password to NO.

What is changed and how it works:
Pass authData to TiDB for the first handshake.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
mysql -h127.1 -udummy -P6001 -pdummy
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'dummy'@'127.0.0.1' (using password: YES)

mysql -h127.1 -udummy -P6001
ERROR 1045 (28000): Access denied for user 'dummy'@'127.0.0.1' (using password: NO)

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 review from bb7133 and xhebox July 19, 2023 07:05
@ti-chi-bot ti-chi-bot bot added the size/S label Jul 19, 2023
@djshow832 djshow832 removed the request for review from bb7133 July 19, 2023 07:06
@ti-chi-bot ti-chi-bot bot added the lgtm label Jul 19, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 19, 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 Jul 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-07-19 07:09:19.761425753 +0000 UTC m=+1093451.531764466: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Jul 19, 2023
@ti-chi-bot ti-chi-bot bot merged commit 56eb332 into pingcap:main Jul 19, 2023
@djshow832 djshow832 deleted the auth_data branch July 19, 2023 07:57
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.

Wrong using password flag when the user is not found
2 participants