-
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
expression: round the frac part for ParseTimeFromFloat64
#56340
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @gengliqi. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/check-issue-triage-complete |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #56340 +/- ##
=================================================
- Coverage 73.4004% 56.5992% -16.8013%
=================================================
Files 1626 1751 +125
Lines 448838 635122 +186284
=================================================
+ Hits 329449 359474 +30025
- Misses 99185 251511 +152326
- Partials 20204 24137 +3933
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@mjonss this might be related to (or conflict with) what you are working on. |
@@ -1814,7 +1814,8 @@ func TestParseTimeFromFloat64(t *testing.T) { | |||
{0.0, mysql.TypeDate, 0, 0, 0, 0, 0, 0, 0, nil}, | |||
{20000102030405, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 0, nil}, | |||
{20000102030405.015625, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 15625, nil}, | |||
{20000102030405.0078125, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7812, nil}, | |||
{20000102030405.0078125, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7813, 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.
The significant digits of the float fractional part is only '.008' I guess, so does it really matter if it is '.007812' or '.007813' ?
Just try this with your PR:
{20000102030405.0078139, mysql.TypeDatetime, 2000, 1, 2, 3, 4, 5, 7814, 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.
Yes. The fractional part is only .008
so the fractional part of your case is still 7813
.
As #56339 (comment) said, I just want to make this behavior consistent with TiKV and MySQL.
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.
OK, then I see.
Can you please add tests that will test TiKV/TiFlash/UniStore handling of co-processor calls for this (if exists), so we can show that all four implementations are the same?
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.
I added an integration test to test TiDB(Unistore)/TiKV. TiFlash does not support date_add/date_sub functions with float as the first parameter for now.
a3f949b
to
5d6be93
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: close #56339
Problem Summary:
See #56339
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.