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: PropagateType should never let orignal data overflow #53045

Merged

Conversation

windtalker
Copy link
Contributor

@windtalker windtalker commented May 7, 2024

What problem does this PR solve?

Issue Number: close #52672

Problem Summary:

What changed and how does it work?

When propagate type in

func PropagateType(evalType types.EvalType, args ...Expression) {

make sure that the original data is never be overflow under new type.

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 do-not-merge/needs-triage-completed do-not-merge/needs-linked-issue 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. and removed do-not-merge/needs-linked-issue do-not-merge/needs-triage-completed labels May 7, 2024
Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.0513%. Comparing base (81da4f8) to head (df4dc92).
Report is 19 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53045        +/-   ##
================================================
+ Coverage   72.0214%   74.0513%   +2.0298%     
================================================
  Files          1508       1510         +2     
  Lines        434823     439603      +4780     
================================================
+ Hits         313166     325532     +12366     
+ Misses       102084      93837      -8247     
- Partials      19573      20234       +661     
Flag Coverage Δ
integration 48.3402% <78.5714%> (?)
unit 71.2461% <100.0000%> (+0.0185%) ⬆️

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

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

@windtalker windtalker force-pushed the not_propagate_type_for_constant branch from 4c3573d to 3fb2172 Compare May 7, 2024 06:49
@windtalker windtalker changed the title expression: do not propagate type for constant expression: PropagateType should never let orignal data overflow May 7, 2024
windtalker added 5 commits May 7, 2024 17:20
Signed-off-by: xufei <[email protected]>
Signed-off-by: xufei <[email protected]>
Signed-off-by: xufei <[email protected]>
Signed-off-by: xufei <[email protected]>
@windtalker windtalker force-pushed the not_propagate_type_for_constant branch from 5a0b18a to e68079c Compare May 7, 2024 09:20
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 7, 2024
Signed-off-by: xufei <[email protected]>
@windtalker
Copy link
Contributor Author

/test unit-test

Copy link

tiprow bot commented May 8, 2024

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

In response to this:

/test unit-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-sigs/prow repository.

@windtalker
Copy link
Contributor Author

/test check-dev

Copy link

tiprow bot commented May 8, 2024

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

In response to this:

/test check-dev

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.

Copy link

ti-chi-bot bot commented May 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guo-shaoge, XuHuaiyu

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 9, 2024
Copy link

ti-chi-bot bot commented May 9, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-07 10:15:10.01161506 +0000 UTC m=+957063.768750631: ☑️ agreed by XuHuaiyu.
  • 2024-05-09 02:38:03.784741903 +0000 UTC m=+1102437.541877476: ☑️ agreed by guo-shaoge.

Copy link

tiprow bot commented May 9, 2024

@windtalker: 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
fast_test_tiprow 7bc5492 link true /test fast_test_tiprow

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 bot merged commit c33b6cd into pingcap:master May 9, 2024
20 of 21 checks passed
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label May 9, 2024
@ti-chi-bot
Copy link
Member

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

terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
@windtalker windtalker deleted the not_propagate_type_for_constant branch July 22, 2024 02:07
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-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.

"Data truncated for column '%s' at row %d"
4 participants