Skip to content
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 compare float64 with float64 in json #21709

Merged

Conversation

lzmhhh123
Copy link
Contributor

Signed-off-by: lzmhhh123 lzmhhh123@gmail.com

What problem does this PR solve?

Issue Number: close #10461

What is changed and how it works?

What's Changed: reference https://github.com/mysql/mysql-server/blob/ee4455a33b10f1b1886044322e4893f587b319ed/sql/json_dom.cc#L2656

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test

Release note

  • fix compare float64 with float64 in json

Signed-off-by: lzmhhh123 <lzmhhh123@gmail.com>
@lzmhhh123 lzmhhh123 requested a review from a team as a code owner December 14, 2020 09:00
@lzmhhh123 lzmhhh123 requested review from wshwsh12 and removed request for a team December 14, 2020 09:00
@ti-challenge-bot
Copy link

There is no reward for this challenge pull request, so you can request a reward from @lzmhhh123.

Details

Tip : About reward you can refs to reward-command.

Warning: None

@lzmhhh123
Copy link
Contributor Author

/run-all-tests

@@ -647,6 +647,16 @@ func compareInt64(x int64, y int64) int {
return 1
}

func compareFloat64(x float64, y float64) int {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use compareFloat64PrecisionLoss

Copy link
Contributor Author

@lzmhhh123 lzmhhh123 Dec 14, 2020

Choose a reason for hiding this comment

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

The origin code used it. Then got the wrong result.

@lzmhhh123
Copy link
Contributor Author

/run-integration-copr-test

Copy link
Contributor

@XuHuaiyu XuHuaiyu 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 14, 2020
@ichn-hu ichn-hu mentioned this pull request Dec 14, 2020
@XuHuaiyu
Copy link
Contributor

PTAL @wshwsh12

Copy link
Contributor

@wshwsh12 wshwsh12 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-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Dec 15, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 15, 2020
@wshwsh12
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 15, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 21733

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit b0d9934 into pingcap:master Dec 15, 2020
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Dec 15, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21785

@lzmhhh123 lzmhhh123 deleted the bug-fix/fix_compare_float64_float64 branch December 15, 2020 05:01
ti-srebot added a commit that referenced this pull request Jan 26, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect JSON float compare
4 participants