Skip to content

Commit

Permalink
fix skip grant (pingcap#283)
Browse files Browse the repository at this point in the history
Signed-off-by: ystaticy <y_static_y@sina.com>
  • Loading branch information
ystaticy authored Feb 27, 2023
1 parent 92b7283 commit 2a25f41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions privilege/privileges/privileges.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,7 @@ func (p *UserPrivileges) ConnectionVerification(user *auth.UserIdentity, authUse
hasPassword = "NO"
}

mysqlPriv := p.Handle.Get()
record := mysqlPriv.connectionVerification(authUser, authHost)
var record *UserRecord = nil

if SkipWithGrant {
p.user = authUser
Expand All @@ -526,6 +525,9 @@ func (p *UserPrivileges) ConnectionVerification(user *auth.UserIdentity, authUse
return
}

mysqlPriv := p.Handle.Get()
record = mysqlPriv.connectionVerification(authUser, authHost)

if record == nil {
logutil.BgLogger().Error("get authUser privilege record fail",
zap.String("authUser", authUser), zap.String("authHost", authHost))
Expand Down

0 comments on commit 2a25f41

Please sign in to comment.