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 incorrect collation when cast non-string type arg to string type #19186

Merged
merged 9 commits into from
Aug 19, 2020

Conversation

xiongjiwei
Copy link
Contributor

@xiongjiwei xiongjiwei commented Aug 13, 2020

What problem does this PR solve?

Issue Number: close #19189 #19166
Problem Summary:

What is changed and how it works?

  • when non-string type args cast to string type, it should set collation to the origin collation.
  • deriveCoercibilityForScarlarFunc should return CoercibilityIgnorable if all args is null

Check List

Tests

  • Unit test
  • Integration test

Release note

  • fix an issue that may get wrong collation result

@ti-srebot ti-srebot added the contribution This PR is from a community contributor. label Aug 13, 2020
@xiongjiwei xiongjiwei marked this pull request as ready for review August 13, 2020 12:35
@xiongjiwei xiongjiwei requested review from a team as code owners August 13, 2020 12:35
@xiongjiwei xiongjiwei requested review from SunRunAway and removed request for a team August 13, 2020 12:35
@xiongjiwei xiongjiwei changed the title Bug collation expression: fix incorrect collation when cast non-string type arg to string type Aug 13, 2020
@xiongjiwei xiongjiwei requested review from wjhuang2016 and removed request for a team August 14, 2020 07:49
@SunRunAway SunRunAway requested review from qw4990 and removed request for SunRunAway August 14, 2020 08:07
Copy link
Member

@wjhuang2016 wjhuang2016 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Aug 17, 2020
Copy link
Contributor

@qw4990 qw4990 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-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Aug 18, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Aug 18, 2020
@xiongjiwei
Copy link
Contributor Author

@qw4990 could please help me merge this PR?

@wjhuang2016
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

@wjhuang2016 Oops! auto merge is restricted to Committers of the SIG.See the corresponding SIG page for more information. Related SIGs: execution(slack).

@wjhuang2016
Copy link
Member

/run-all-tests

@wjhuang2016 wjhuang2016 merged commit 5153a41 into pingcap:master Aug 19, 2020
@xiongjiwei xiongjiwei deleted the bug-collation branch August 19, 2020 07:53
@wjhuang2016 wjhuang2016 added the sig/sql-infra SIG: SQL Infra label Aug 28, 2020
@xiongjiwei
Copy link
Contributor Author

/label needs-cherry-pick-4.0

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jan 28, 2021
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #22599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression contribution This PR is from a community contributor. sig/sql-infra SIG: SQL Infra status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

result of select collation(concat(1,1)); is wrong
4 participants