-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
sessionctx/variable: change default_authentication_plugin
from mysql_native_password
to caching_sha2_password
#54326
Conversation
…ql_native_password` to `caching_sha2_password` Since `caching_sha2_password` is safer than the default `mysql_native_password`, it is better for tidb to support this compatibility with MySQL
Hi @ei-sugimoto. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @ei-sugimoto. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54326 +/- ##
================================================
- Coverage 72.8268% 70.0640% -2.7628%
================================================
Files 1560 1567 +7
Lines 438616 467966 +29350
================================================
+ Hits 319430 327876 +8446
- Misses 99584 119427 +19843
- Partials 19602 20663 +1061
Flags with carried forward coverage won't be shown. Click here to find out more.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…l_native_password` to `caching_sha2_password`. Since it is the default authentication plugin for MySQL 8.0 and later.
pkg/server/conn_test.go
Outdated
@@ -1163,9 +1163,13 @@ func TestHandleAuthPlugin(t *testing.T) { | |||
server: srv, | |||
user: "unativepassword", | |||
} | |||
|
|||
if cc.pkt == nil { | |||
t.Fatal("pktフィールドがnilです。") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write in English in any string literal or code comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, please refer to the update part in the issue description. Let's just change the code here like
diff --git a/pkg/executor/simple.go b/pkg/executor/simple.go
index 56432c4556..87c2f9b102 100644
--- a/pkg/executor/simple.go
+++ b/pkg/executor/simple.go
@@ -1151,7 +1151,10 @@ func (e *SimpleExec) executeCreateUser(ctx context.Context, s *ast.CreateUserStm
e.Ctx().GetSessionVars().StmtCtx.AppendNote(err)
continue
}
- authPlugin := mysql.AuthNativePassword
+ authPlugin, err := e.Ctx().GetSessionVars().GlobalVarsAccessor.GetGlobalSysVar(variable.DefaultAuthPlugin)
+ if err != nil {
+ return err
+ }
if spec.AuthOpt != nil && spec.AuthOpt.AuthPlugin != "" {
authPlugin = spec.AuthOpt.AuthPlugin
}
[LGTM Timeline notifier]Timeline:
|
[FORMAT CHECKER NOTIFICATION] Notice: To remove the For example:
📖 For more info, you can check the "Contribute Code" section in the development guide. |
@ei-sugimoto: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
@ei-sugimoto: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Since
caching_sha2_password
is safer than the defaultmysql_native_password
, it is better for tidb to support this compatibility with MySQLWhat problem does this PR solve?
Issue Number: close #54138
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.