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: avoid refinement of arguments on nullable value #55805

Merged
merged 3 commits into from
Sep 29, 2024

Conversation

tuziemon
Copy link
Contributor

@tuziemon tuziemon commented Sep 2, 2024

What problem does this PR solve?

Issue Number: close #44706

Problem Summary:

What changed and how does it work?

Currently, the equation of an unsigned int constant and a signed int column is replaced by the equation of constants 1 and 0.
However, this produces an incorrect result if the column is null, so a check for notnullflag should be added.

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 release-note-none Denotes a PR that doesn't merit a release note. needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 2, 2024
Copy link

ti-chi-bot bot commented Sep 2, 2024

Hi @tuziemon. Thanks for your PR.

I'm waiting for a pingcap 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.

Copy link

tiprow bot commented Sep 2, 2024

Hi @tuziemon. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

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

@hawkingrei
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. labels Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.9893%. Comparing base (c56694c) to head (c4c619e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #55805        +/-   ##
================================================
+ Coverage   73.3670%   74.9893%   +1.6222%     
================================================
  Files          1622       1665        +43     
  Lines        447161     478252     +31091     
================================================
+ Hits         328069     358638     +30569     
+ Misses        98984      98410       -574     
- Partials      20108      21204      +1096     
Flag Coverage Δ
integration 48.8592% <100.0000%> (?)
unit 72.4620% <100.0000%> (+0.0169%) ⬆️

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

Components Coverage Δ
dumpling 52.9478% <ø> (ø)
parser ∅ <ø> (∅)
br 52.1005% <72.7272%> (+6.5940%) ⬆️

@tuziemon
Copy link
Contributor Author

tuziemon commented Sep 3, 2024

/retest

1 similar comment
@tuziemon
Copy link
Contributor Author

tuziemon commented Sep 3, 2024

/retest

Copy link
Contributor

@lance6716 lance6716 left a comment

Choose a reason for hiding this comment

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

Thanks. Can you add an test that shows the SQL in #44706 now returns correct result? You can take a look at pkg/expression/integration_test/integration_test.go

@tuziemon
Copy link
Contributor Author

tuziemon commented Sep 5, 2024

Thank you for your comment.
I added the integration test to pkg/expression/integration_test/integration_test.go.

@lance6716
Copy link
Contributor

/cc @zanmato1984 @windtalker

@tuziemon
Copy link
Contributor Author

tuziemon commented Sep 5, 2024

/retest

Copy link
Contributor

@windtalker windtalker 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 approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 6, 2024
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 28, 2024
Copy link

ti-chi-bot bot commented Sep 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, 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 Sep 29, 2024
Copy link

ti-chi-bot bot commented Sep 29, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-06 01:43:52.211055215 +0000 UTC m=+581556.729108141: ☑️ agreed by windtalker.
  • 2024-09-29 01:31:38.290553141 +0000 UTC m=+145653.710766153: ☑️ agreed by XuHuaiyu.

@windtalker
Copy link
Contributor

@tuziemon can you rebase this pr, this will be merged automatically after it is rebased.

@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 29, 2024
@ti-chi-bot ti-chi-bot bot merged commit dffc0c9 into pingcap:master Sep 29, 2024
23 checks passed
@tuziemon tuziemon deleted the fix/44706 branch September 29, 2024 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. 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.

Unexpected results of ANY operator
5 participants