-
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:implement function password. #3271
Conversation
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.
@tiancaiamao @XuHuaiyu PTAL
expression/builtin_encryption.go
Outdated
return d, errFunctionNotExists.GenByArgs("PASSWORD") | ||
args, err := b.evalArgs(row) | ||
if err != nil { | ||
return types.Datum{}, errors.Trace(err) |
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.
return d, errors.Trace(err)
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.
SELECT PASSWORD(NULL) return empty string instead of NULL.
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.
Got it, i will fix
expression/builtin_encryption.go
Outdated
return d, errors.Trace(err) | ||
} | ||
|
||
if pass == "" { |
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.
if length(pass) == 0
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.
I'll fix it
expression/builtin_encryption.go
Outdated
h2 := sha1.New() | ||
h2.Write(hash1) | ||
hash2 := h2.Sum(nil) | ||
ret := "*" + fmt.Sprintf("%X", hash2) |
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.
ret := fmt.Sprintf("*%X", hash2)
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.
need the "*", you can test on MySQL
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.
I got it, make "*" in the format string
Conflicts: expression/builtin_encryption.go
@shenli PTAL |
move to new PR #3275 |
No description provided.