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

executor: Fix issue that in expression with null constant produces unexpected cast warnings #49460

Closed
wants to merge 3 commits into from

Conversation

yibin87
Copy link
Contributor

@yibin87 yibin87 commented Dec 14, 2023

What problem does this PR solve?

Issue Number: close #49015

Problem Summary:

What changed and how does it work?

For comparisons which contains constant null as parameter, if field types are not the same, set null constant's field type as the other one's to avoid useless cast.

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 release-note-none Denotes a PR that doesn't merit a release note. labels Dec 14, 2023
Copy link

ti-chi-bot bot commented Dec 14, 2023

[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 windtalker for approval. For more information see the Kubernetes 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 the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 14, 2023
Copy link

tiprow bot commented Dec 14, 2023

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

@yibin87 yibin87 changed the title executor: Fix issue that in expression may produce cast null as other types ope… executor: Fix issue that in expression produces cast null as other types warnings Dec 14, 2023
@yibin87 yibin87 changed the title executor: Fix issue that in expression produces cast null as other types warnings executor: Fix issue that in expression with null constant produces unexpected cast warnings Dec 14, 2023
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Merging #49460 (b397129) into master (1cfb3b9) will not change coverage.
Report is 4 commits behind head on master.
The diff coverage is n/a.

Additional details and impacted files
@@             Coverage Diff             @@
##             master     #49460   +/-   ##
===========================================
  Coverage   70.9865%   70.9865%           
===========================================
  Files          1368       1368           
  Lines        399849     399849           
===========================================
  Hits         283839     283839           
  Misses        96192      96192           
  Partials      19818      19818           
Flag Coverage Δ
integration ∅ <ø> (?)
unit 70.9865% <ø> (ø)

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

Components Coverage Δ
dumpling 53.9663% <ø> (ø)
parser ∅ <ø> (∅)
br 52.8848% <ø> (ø)

Copy link

ti-chi-bot bot commented Dec 14, 2023

@yibin87: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
idc-jenkins-ci-tidb/mysql-test b397129 link true /test mysql-test
idc-jenkins-ci-tidb/check_dev b397129 link true /test check-dev
idc-jenkins-ci-tidb/check_dev_2 b397129 link true /test check-dev2

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.

@yibin87
Copy link
Contributor Author

yibin87 commented Dec 14, 2023

This fix will change "select str_to_date('2007-10-00 12:34','%Y-%m-%d %H:%i') = '2007-10-00 12:34';" execution behavior:
Previously, report error, due to cast('2007-10-00 12:34' as datetime)
Now, return Null without trying cast('2007-10-00 12:34' as datetime)

@yibin87 yibin87 closed this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. 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.

IN clause on a non-integer column with NULL value would cause unexpected warning or error
1 participant