-
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
evaluator: change the remaining string functions. #1000
Conversation
Change the remaining string functions.
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) { |
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.
Put d.SetNull()
here, then if err != nil
is true , we don't need to set it again?
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 |
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.
Default kind for datum is KindNull?
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.
yep
LGTM |
evaluator: change the remaining string functions.
Change the remaining string functions.