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

evaluator: change the remaining string functions. #1000

Merged
merged 2 commits into from
Mar 22, 2016

Conversation

zxylvlp
Copy link
Contributor

@zxylvlp zxylvlp commented Mar 22, 2016

Change the remaining string functions.

Change the remaining string functions.
@zxylvlp
Copy link
Contributor Author

zxylvlp commented Mar 22, 2016

@coocood @shenli

func builtinStrcmp(args []interface{}, _ context.Context) (interface{}, error) {
if args[0] == nil || args[1] == nil {
return nil, nil
func builtinStrcmp(args []types.Datum, _ context.Context) (d types.Datum, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Put d.SetNull() here, then if err != nil is true , we don't need to set it again?

@zimulala
Copy link
Contributor

LGTM

return nil, nil
func builtinStrcmp(args []types.Datum, _ context.Context) (d types.Datum, err error) {
if args[0].Kind() == types.KindNull || args[1].Kind() == types.KindNull {
return d, nil
Copy link
Member

Choose a reason for hiding this comment

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

Default kind for datum is KindNull?

Copy link
Contributor

Choose a reason for hiding this comment

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

yep

@shenli
Copy link
Member

shenli commented Mar 22, 2016

LGTM

zxylvlp added a commit that referenced this pull request Mar 22, 2016
evaluator: change the remaining string functions.
@zxylvlp zxylvlp merged commit ad5657f into master Mar 22, 2016
@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
xhebox pushed a commit to xhebox/tidb that referenced this pull request Sep 28, 2021
xhebox pushed a commit to xhebox/tidb that referenced this pull request Oct 8, 2021
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.

4 participants