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: set a collation according to the arguments for ifnull in constant folding #52119

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Mar 26, 2024

What problem does this PR solve?

Issue Number: close #51765

Problem Summary:

The ifnull has different behavior in inferring collation for constant folding and normal execution path.

What changed and how does it work?

Set the collation according to the first argument in the path of constant folding.

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.

Release note

Fix the issue that the collation of `ifnull` expression is different with MySQL when constant folding applies.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 26, 2024
@YangKeao YangKeao requested a review from lcwangchao March 26, 2024 13:46
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked labels Mar 26, 2024
@YangKeao YangKeao requested a review from zanmato1984 March 26, 2024 13:48
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Mar 26, 2024
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Merging #52119 (a050b21) into master (094f4df) will decrease coverage by 15.9751%.
Report is 2 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #52119         +/-   ##
=================================================
- Coverage   70.6856%   54.7105%   -15.9751%     
=================================================
  Files          1486       1597        +111     
  Lines        439484     609164     +169680     
=================================================
+ Hits         310652     333277      +22625     
- Misses       109326     252663     +143337     
- Partials      19506      23224       +3718     
Flag Coverage Δ
integration 36.6785% <100.0000%> (?)
unit 70.4423% <100.0000%> (-0.0555%) ⬇️

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

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

Copy link
Contributor

@zanmato1984 zanmato1984 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 Mar 26, 2024
Copy link

ti-chi-bot bot commented Mar 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zanmato1984, zimulala

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

ti-chi-bot bot commented Mar 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-26 17:44:15.829955002 +0000 UTC m=+2003482.852201386: ☑️ agreed by zanmato1984.
  • 2024-03-27 01:53:09.846229352 +0000 UTC m=+2032816.868475741: ☑️ agreed by zimulala.

@zimulala
Copy link
Contributor

/check-issue-triage-complete

@ti-chi-bot ti-chi-bot bot merged commit 7b8fd37 into pingcap:master Mar 27, 2024
23 checks passed
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 27, 2024
@YangKeao YangKeao added 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. labels Mar 27, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Mar 27, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Mar 27, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Apr 12, 2024
ti-chi-bot bot pushed a commit that referenced this pull request May 21, 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-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.

expression "ifnull(concat(NULL),'~')" show hex
4 participants