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: fix precision when casting float to string #9137

Merged
merged 4 commits into from Jan 29, 2019

Conversation

Projects
None yet
5 participants
@tiancaiamao
Copy link
Contributor

tiancaiamao commented Jan 21, 2019

What problem does this PR solve?

Fix #9123

What is changed and how it works?

Cast float32(208.867) to float64 will get float64(208.86700439), and
convert the later to string will get a result with wrong precision

Check List

Tests

  • Unit test

PTAL @XuHuaiyu @eurekaka

expression: fix precision when casting float to string
Cast float32(208.867) to float64 will get float64(208.86700439), and
convert the later to string will get a result with wrong precision
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 21, 2019

Codecov Report

Merging #9137 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9137      +/-   ##
=========================================
- Coverage   67.21%   67.2%   -0.02%     
=========================================
  Files         371     371              
  Lines       76982   76985       +3     
=========================================
- Hits        51743   51737       -6     
- Misses      20618   20624       +6     
- Partials     4621    4624       +3
Impacted Files Coverage Δ
expression/builtin_cast.go 80.01% <100%> (+0.05%) ⬆️
ddl/delete_range.go 75.13% <0%> (-4.24%) ⬇️
store/tikv/scan.go 73.94% <0%> (-3.37%) ⬇️
expression/schema.go 94.11% <0%> (-0.85%) ⬇️
executor/join.go 78.38% <0%> (+0.52%) ⬆️
executor/index_lookup_join.go 77.91% <0%> (+0.63%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19a0039...03dbbf6. Read the comment docs.

@eurekaka
Copy link
Contributor

eurekaka left a comment

LGTM

@eurekaka

This comment has been minimized.

Copy link
Contributor

eurekaka commented Jan 22, 2019

@tiancaiamao does this fix need to be cherry-picked to release branches?

@tiancaiamao

This comment has been minimized.

Copy link
Contributor Author

tiancaiamao commented Jan 22, 2019

Maybe I should do that @eurekaka

@tiancaiamao tiancaiamao self-assigned this Jan 23, 2019

@zz-jason
Copy link
Member

zz-jason left a comment

LGTM

@zz-jason

This comment has been minimized.

Copy link
Member

zz-jason commented Jan 28, 2019

/run-all-tests

zimulala and others added some commits Jan 28, 2019

@zz-jason zz-jason merged commit bf5a0b4 into pingcap:master Jan 29, 2019

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
idc-jenkins-ci-tidb/build Jenkins job succeeded.
Details
idc-jenkins-ci-tidb/check_dev Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@tiancaiamao tiancaiamao deleted the tiancaiamao:issue9123 branch Jan 30, 2019

tiancaiamao added a commit to tiancaiamao/tidb that referenced this pull request Jan 30, 2019

zz-jason added a commit that referenced this pull request Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment