-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
types: fix bug which Float type is not effective in AddDate & SubDate function #7840
Conversation
@@ -2707,6 +2719,11 @@ func (c *addDateFunctionClass) getFunction(ctx sessionctx.Context, args []Expres | |||
baseBuiltinFunc: bf, | |||
baseDateArithmitical: newDateArighmeticalUtil(), | |||
} | |||
case dateEvalTp == types.ETInt && intervalEvalTp == types.ETDecimal: |
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.
Could you extract a function to check if we should use Decimal math, there are some redundant code, and it's easy to make mistake to write compose equal condition.
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.
LGTM
@XuHuaiyu @tiancaiamao PTAL |
/run-all-tests |
/run-all-tests |
/run-all-tests |
LGTM |
What problem does this PR solve?
Before this pr, there are some bugs in AddDate & SubDate function like follow
What is changed and how it works?
After this pr, the queries are like follow
All these results are same as MySQL.
Check List
Tests
Code changes