-
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
builtin: add make_set built-in function #2831
Conversation
expression/builtin_string.go
Outdated
if err != nil { | ||
return types.Datum{}, errors.Trace(err) | ||
} | ||
d.SetString("") |
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 args[0].IsNull(), mysql will return null.
mysql> SELECT MAKE_SET(NULL,'a','b','c');
+----------------------------+
| MAKE_SET(NULL,'a','b','c') |
+----------------------------+
| NULL |
+----------------------------+
expression/builtin_string.go
Outdated
if args[i].IsNull() { | ||
continue | ||
} | ||
if string(bitsValue[i-1]) == "1" { |
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.
It is better to use int bit-wise and shift operation. Not string compare.
@shenli fixed and plz review again. |
LGTM |
2b463e6
to
fb3c878
Compare
Sorry for the delay, there are many PRs conflicting on typeinfer files. |
OK, got it. |
The test could not reflect the reality, if you run the binary, you'll get this:
That's because,
Okay, it involves another problem. LGTM |
@tiancaiamao I test on my machine and it works well (mysql version: 5.7.17):
|
No description provided.