Skip to content

Conversation

yibin87
Copy link
Contributor

@yibin87 yibin87 commented May 7, 2024

What problem does this PR solve?

Issue Number: close #52978

Problem Summary:
The root cause is tidb's truncate function returns NaN for corner cases. While in topN executor, we compare float64 using go lib function which treats NaN as min:

return cmp.Compare(l.GetFloat64(lCol), r.GetFloat64(rCol))

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 7, 2024
@yibin87
Copy link
Contributor Author

yibin87 commented May 7, 2024

/cc @windtalker @xzhangxian1008

@ti-chi-bot ti-chi-bot bot requested review from windtalker and xzhangxian1008 May 7, 2024 07:51
@yibin87 yibin87 changed the title executor: Fix truncate function behavior when second param is large negative executor,types: Fix truncate function behavior when second param is large negative May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 73.9395%. Comparing base (de92425) to head (229c75b).
Report is 15 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53075        +/-   ##
================================================
+ Coverage   72.0209%   73.9395%   +1.9185%     
================================================
  Files          1508       1509         +1     
  Lines        434747     441028      +6281     
================================================
+ Hits         313109     326094     +12985     
+ Misses       102056      94732      -7324     
- Partials      19582      20202       +620     
Flag Coverage Δ
integration 49.1921% <0.0000%> (?)
unit 71.2087% <40.0000%> (-0.0154%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 46.1915% <ø> (+7.8562%) ⬆️

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 8, 2024
Copy link
Contributor

@xzhangxian1008 xzhangxian1008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

ti-chi-bot bot commented May 8, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, xzhangxian1008

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 8, 2024
Copy link

ti-chi-bot bot commented May 8, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-08 06:13:16.975423176 +0000 UTC m=+1028950.732558749: ☑️ agreed by windtalker.
  • 2024-05-08 07:32:26.183502645 +0000 UTC m=+1033699.940638218: ☑️ agreed by xzhangxian1008.

@ti-chi-bot ti-chi-bot bot merged commit 57b382b into pingcap:master May 8, 2024
Copy link

tiprow bot commented May 8, 2024

@yibin87: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
tidb_parser_test 229c75b link true /test tidb_parser_test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot ti-chi-bot added needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. and removed needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels May 9, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #53124.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #53125.

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request could not be created: failed to create pull request against pingcap/tidb#release-7.5 from head ti-chi-bot:cherry-pick-53075-to-release-7.5: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for ti-chi-bot:cherry-pick-53075-to-release-7.5."}],"documentation_url":"https://docs.github.com/rest/pulls/pulls#create-a-pull-request"}

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 9, 2024
ti-chi-bot bot pushed a commit that referenced this pull request May 9, 2024
ti-chi-bot bot pushed a commit that referenced this pull request May 10, 2024
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
RidRisR pushed a commit to RidRisR/tidb that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

min(truncate()) may lead to incorrect result
4 participants