From 9d798d5acfdce77d88e5985e91a85c2c46a46c91 Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Wed, 25 Aug 2021 09:18:04 +0800 Subject: [PATCH] privileges: Fix panic when using skip-grant-table (#27558) (#27559) --- privilege/privileges/privileges.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/privilege/privileges/privileges.go b/privilege/privileges/privileges.go index 1e8aaf882fcba..077e9d38633fe 100644 --- a/privilege/privileges/privileges.go +++ b/privilege/privileges/privileges.go @@ -221,6 +221,10 @@ func (p *UserPrivileges) GetEncodedPassword(user, host string) string { // GetAuthPlugin gets the authentication plugin for the account identified by the user and host func (p *UserPrivileges) GetAuthPlugin(user, host string) (string, error) { + if SkipWithGrant { + return mysql.AuthNativePassword, nil + } + mysqlPriv := p.Handle.Get() record := mysqlPriv.connectionVerification(user, host) if record == nil {