Skip to content
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

Closed
wants to merge 12 commits into from

Conversation

louishust
Copy link
Contributor

No description provided.

Copy link
Member

@shenli shenli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return d, errFunctionNotExists.GenByArgs("PASSWORD")
args, err := b.evalArgs(row)
if err != nil {
return types.Datum{}, errors.Trace(err)
Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

return d, errors.Trace(err)
}

if pass == "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if length(pass) == 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it

h2 := sha1.New()
h2.Write(hash1)
hash2 := h2.Sum(nil)
ret := "*" + fmt.Sprintf("%X", hash2)
Copy link
Member

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)

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@zimulala zimulala added the contribution This PR is from a community contributor. label May 16, 2017
@louishust
Copy link
Contributor Author

@shenli PTAL

@louishust
Copy link
Contributor Author

move to new PR #3275

@louishust louishust closed this May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants