-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat: Support MySQL CAST_DECIMAL function #572
Conversation
pkg/runtime/function/cast_decimal.go
Outdated
return nil, errors.WithStack(err) | ||
} | ||
if maxNum == nil { | ||
maxNum = 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.
maybe the default max num is 10, refer to https://dev.mysql.com/doc/refman/5.6/en/fixed-point-types.html.
pls resolve the conflict. |
# Conflicts: # pkg/runtime/function/left.go # pkg/runtime/function/power.go # pkg/runtime/function/rand.go # pkg/runtime/function/rpad.go # pkg/runtime/function/sin.go
Codecov ReportBase: 35.50% // Head: 35.50% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #572 +/- ##
=======================================
Coverage 35.50% 35.50%
=======================================
Files 188 188
Lines 21490 21490
=======================================
Hits 7630 7630
Misses 12977 12977
Partials 883 883
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
pkg/runtime/function/cast_decimal.go
Outdated
if err != nil { | ||
return nil, errors.WithStack(err) | ||
} | ||
v := math.ToDecimal(val) |
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.
Use val.Decimal()
instead.
pkg/runtime/function/cast_decimal.go
Outdated
if precision == nil { | ||
precision = 0 | ||
} | ||
d, err := strconv.Atoi(fmt.Sprint(precision)) |
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.
Use precision.Int64()
instead.
* Ftr: arana-db#571 * fix: 572
What this PR does:
Support MySQL CAST_DECIMAL function #571