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 wrong result when convert float to unsigned (#53590) #53609

Conversation

ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #53590

What problem does this PR solve?

Issue Number: close #41736

Problem Summary:

  1. When compare int column with non int constant, will convert non int constant to int
  2. This logic is used to check if underflow happens when convert to int, which requires we should set result as zero when convert X to unsigned int
  3. But ConvertFloatToUint will not obey this requirement when AllowNegativeToUnsigned is disabled.

PS: what does AllowNegativeToUnsigned mean, check description here

What changed and how does it work?

Disable AllowNegativeToUnsigned when conversion happens when compare int column with non int constant.

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.

expression: fix wrong result when convert float to unsigned

@ti-chi-bot ti-chi-bot added 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-5.3 labels May 28, 2024
@ti-chi-bot ti-chi-bot added the cherry-pick-approved Cherry pick PR approved by release team. label May 28, 2024
Copy link

ti-chi-bot bot commented May 28, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chrysan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 28, 2024
@guo-shaoge
Copy link
Collaborator

Maintenance Support ends for v5.3, so close it.

@guo-shaoge guo-shaoge closed this May 28, 2024
@JaySon-Huang JaySon-Huang deleted the cherry-pick-53590-to-release-5.3 branch June 12, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/cherry-pick-for-release-5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants