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

expression: fix casting REAL type to STRING type #16975

Merged
merged 9 commits into from
May 11, 2024

Conversation

solotzg
Copy link
Contributor

@solotzg solotzg commented May 9, 2024

What is changed and how it works?

Issue Number: Close #16974

ref pingcap/tidb#53129

What's Changed:

expression: fix casting REAL type to STRING type
- unify the behavior of converting real types to strings in tidb#53129 and tikv.
- use ryu lib in tikv to implement casting real type to str type.
- `if abs(num) >= 1e15 or (num is not zero and abs(num) < 1e-15)` then use decimal exponent format 

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

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

Release note

Fix the incorrect result when casting REAL type to STRING type

1
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
2
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
Copy link
Contributor

ti-chi-bot bot commented May 9, 2024

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • gengliqi
  • wshwsh12

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. contribution This PR is from a community contributor. labels May 9, 2024
Copy link
Contributor

ti-chi-bot bot commented May 9, 2024

Hi @solotzg. Thanks for your PR.

I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@ti-chi-bot ti-chi-bot bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 9, 2024
3
Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>
@solotzg solotzg changed the title expression: unify casting real to string in tikv expression: fix casting REAL type to STRING type May 9, 2024
@solotzg
Copy link
Contributor Author

solotzg commented May 9, 2024

/cc @wshwsh12 @gengliqi

@ti-chi-bot ti-chi-bot bot requested review from gengliqi and wshwsh12 May 9, 2024 14:14
@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 10, 2024
@solotzg
Copy link
Contributor Author

solotzg commented May 10, 2024

/ok-to-test

Copy link
Contributor

ti-chi-bot bot commented May 10, 2024

@solotzg: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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/test-infra repository.

@gengliqi
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added ok-to-test Indicates a PR is ready to be tested. and removed needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. do-not-merge/needs-triage-completed labels May 10, 2024
@gengliqi gengliqi added needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. 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. labels May 10, 2024
@ti-chi-bot ti-chi-bot bot added the status/LGT2 Indicates that a PR has LGTM 2. label May 11, 2024
@gengliqi
Copy link
Member

/merge

Copy link
Contributor

ti-chi-bot bot commented May 11, 2024

@gengliqi: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

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 ti-community-infra/tichi repository.

Copy link
Contributor

ti-chi-bot bot commented May 11, 2024

This pull request has been accepted and is ready to merge.

Commit hash: ef1f2e5

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label May 11, 2024
@ti-chi-bot ti-chi-bot bot merged commit 7fb3666 into tikv:master May 11, 2024
7 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone May 11, 2024
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request May 11, 2024
close tikv#16974

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@solotzg solotzg deleted the fix-tidb-51109 branch May 11, 2024 10:21
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request May 13, 2024
close #16974

expression: fix casting REAL type to STRING type
- unify the behavior of converting real types to strings in tidb#53129 and tikv.
- use ryu lib in tikv to implement casting real type to str type.
- `if abs(num) >= 1e15 or (num is not zero and abs(num) < 1e-15)` then use decimal exponent format

Signed-off-by: TONG, Zhigao <tongzhigao@pingcap.com>

Co-authored-by: TONG, Zhigao <tongzhigao@pingcap.com>
solotzg added a commit to solotzg/tikv that referenced this pull request May 14, 2024
solotzg added a commit to solotzg/tikv that referenced this pull request May 14, 2024
ti-chi-bot bot added a commit that referenced this pull request May 22, 2024
close #16974

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@ti-chi-bot ti-chi-bot removed the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label May 28, 2024
@ti-chi-bot ti-chi-bot bot mentioned this pull request Jun 26, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor. needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unexpected result: casting real to string
4 participants