-
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
expression: MySQL compatible current_user function #7801
Changes from 5 commits
c17b4c4
61f679a
a49b1a6
8ebd919
8787502
1c49b76
e219ab4
fe51eed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1000,16 +1000,20 @@ func (s *session) Auth(user *auth.UserIdentity, authentication []byte, salt []by | |
|
||
// Check IP. | ||
if pm.ConnectionVerification(user.Username, user.Hostname, authentication, salt) { | ||
user.MatchedUsername, user.MatchedHostname = pm.ConnectionMatchIdentity(user.Username, user.Hostname) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could be done once if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good. I thought about this some more, and I think we should call it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree! |
||
s.sessionVars.User = user | ||
return true | ||
} | ||
|
||
// Check Hostname. | ||
for _, addr := range getHostByIP(user.Hostname) { | ||
if pm.ConnectionVerification(user.Username, addr, authentication, salt) { | ||
u, h := pm.ConnectionMatchIdentity(user.Username, addr) | ||
s.sessionVars.User = &auth.UserIdentity{ | ||
Username: user.Username, | ||
Hostname: addr, | ||
Username: user.Username, | ||
Hostname: addr, | ||
MatchedUsername: u, | ||
MatchedHostname: h, | ||
} | ||
return true | ||
} | ||
|
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.
How about change this method signature to
Then we can remove the
ConnectionMatchIdentity
method ?