Skip to content

Conversation

lcwangchao
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #47945

Problem Summary:

What is changed and how it works?

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.

fix issue that we can insert negative value to unsinged float column sometimes

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 24, 2023
@@ -1012,9 +1012,6 @@ func ProduceFloatWithSpecifiedTp(f float64, target *FieldType, sc *stmtctx.State
// If no D is set, we will handle it like origin float whether M is set or not.
if target.GetFlen() != UnspecifiedLength && target.GetDecimal() != UnspecifiedLength {
f, err = TruncateFloat(f, target.GetFlen(), target.GetDecimal())
if err = sc.HandleOverflow(err, err); err != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

HandleOverflow seems useless now, because in cast expr like cast("1" as float(2, 1)) , target.GetDecimal() always return UnspecifiedLength ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In mysql cast to float with decimal will fail:

mysql> select cast("1" as float(1, 0));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ', 0))' at line 1

@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

Merging #47946 (81bd717) into master (a7fff4a) will increase coverage by 1.0217%.
Report is 7 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47946        +/-   ##
================================================
+ Coverage   71.7764%   72.7981%   +1.0217%     
================================================
  Files          1401       1424        +23     
  Lines        405664     412046      +6382     
================================================
+ Hits         291171     299962      +8791     
+ Misses        94750      93197      -1553     
+ Partials      19743      18887       -856     
Flag Coverage Δ
integration 41.9305% <44.4444%> (?)
unit 71.7351% <100.0000%> (-0.0413%) ⬇️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser ∅ <ø> (∅)
br 48.7547% <ø> (-4.2496%) ⬇️

@lcwangchao
Copy link
Collaborator Author

/retest

1 similar comment
@lcwangchao
Copy link
Collaborator Author

/retest

Copy link
Member

@bb7133 bb7133 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 the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 25, 2023
Copy link
Member

@YangKeao YangKeao 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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 25, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 25, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-25 03:28:15.66294981 +0000 UTC m=+2405293.250059956: ☑️ agreed by bb7133.
  • 2023-10-25 06:36:44.794253563 +0000 UTC m=+2416602.381363693: ☑️ agreed by YangKeao.

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 25, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bb7133, XuHuaiyu, YangKeao

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 the approved label Oct 25, 2023
@XuHuaiyu XuHuaiyu added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Oct 25, 2023
@tiprow
Copy link

tiprow bot commented Oct 25, 2023

@lcwangchao: 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
tiprow_fast_test 81bd717 link true /test tiprow_fast_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/test-infra repository. I understand the commands that are listed here.

@lcwangchao
Copy link
Collaborator Author

/retest

@ti-chi-bot ti-chi-bot bot merged commit 97310ad into pingcap:master Oct 25, 2023
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 25, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 25, 2023
@lcwangchao lcwangchao deleted the fix_47945 branch October 25, 2023 14:24
ti-chi-bot bot pushed a commit that referenced this pull request Feb 1, 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-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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

we can insert negative value to unsinged float column sometimes
5 participants