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: do not rewrite like to = if new collation is enabled #21893

Merged
merged 7 commits into from
Dec 23, 2020

Conversation

xiongjiwei
Copy link
Contributor

@xiongjiwei xiongjiwei commented Dec 21, 2020

What problem does this PR solve?

Issue Number: close #21892

  • the like function and = are different if using utf8mb4_unicode_ci collation even if the pattern does not has wildcard. so we cannot rewrite like to = if new collation is enabled.

see also operator_like

Check List

Tests

  • Unit test

Release note

  • fix a bug that the like function returns the wrong result when using collation

@xiongjiwei xiongjiwei requested a review from a team as a code owner December 21, 2020 03:52
@xiongjiwei xiongjiwei requested review from a team and lzmhhh123 and removed request for a team December 21, 2020 03:52
@xiongjiwei
Copy link
Contributor Author

/run-all-tests

@xiongjiwei xiongjiwei marked this pull request as draft December 21, 2020 04:05
@github-actions github-actions bot added the sig/planner SIG: Planner label Dec 21, 2020
@xiongjiwei xiongjiwei marked this pull request as ready for review December 21, 2020 05:45
@xiongjiwei
Copy link
Contributor Author

there are some reasons to rewrite like to = (#8962) , but we cannot do it anymore when the collation is enable.

@xiongjiwei xiongjiwei changed the title expression: remove rewrite like to = if pattern has no wildcard expression: remove rewrite like to = if pattern has no wildcard and new collation is enabled Dec 21, 2020
@xiongjiwei xiongjiwei changed the title expression: remove rewrite like to = if pattern has no wildcard and new collation is enabled expression: do not rewrite like to = if new collation is enabled Dec 21, 2020
@xiongjiwei
Copy link
Contributor Author

@winoros @wjhuang2016 PTAL

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 Dec 21, 2020
Copy link
Contributor

@Reminiscent Reminiscent 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 Dec 22, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Dec 22, 2020
@wjhuang2016
Copy link
Member

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 22, 2020
@ti-srebot
Copy link
Contributor

Your auto merge job has been accepted, waiting for:

  • 21776
  • 21788

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@xiongjiwei merge failed.

@wjhuang2016
Copy link
Member

/merge

@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot ti-srebot merged commit 49791bc into pingcap:master Dec 23, 2020
@xiongjiwei
Copy link
Contributor Author

/label needs-cherry-pick-4.0

@xiongjiwei
Copy link
Contributor Author

/run-cherry-pick

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Jan 26, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #22531

ti-srebot added a commit that referenced this pull request Jan 27, 2021
@xiongjiwei xiongjiwei added the type/bugfix This PR fixes a bug. label Oct 13, 2021
@xiongjiwei xiongjiwei deleted the bug-like branch September 23, 2022 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression sig/planner SIG: Planner status/can-merge Indicates a PR has been approved by a committer. 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.

the like function get wrong result with new collation
4 participants