diff --git a/auth.go b/auth.go index 0b59f52ee..2f61ecd4f 100644 --- a/auth.go +++ b/auth.go @@ -241,7 +241,7 @@ func (mc *mysqlConn) auth(authData []byte, plugin string) ([]byte, bool, error) switch plugin { case "caching_sha2_password": authResp := scrambleSHA256Password(authData, mc.cfg.Passwd) - return authResp, (authResp == nil), nil + return authResp, false, nil case "mysql_old_password": if !mc.cfg.AllowOldPasswords { diff --git a/auth_test.go b/auth_test.go index 407363be4..bd0e2189c 100644 --- a/auth_test.go +++ b/auth_test.go @@ -764,7 +764,7 @@ func TestAuthSwitchCachingSHA256PasswordEmpty(t *testing.T) { t.Errorf("got error: %v", err) } - expectedReply := []byte{1, 0, 0, 3, 0} + expectedReply := []byte{0, 0, 0, 3} if !bytes.Equal(conn.written, expectedReply) { t.Errorf("got unexpected data: %v", conn.written) }