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

planner: The length function could not be substitute when collation of mapped column is utfxxx_bin #54179

Merged
merged 7 commits into from
Jun 27, 2024

Conversation

elsa0520
Copy link
Contributor

What problem does this PR solve?

The constant propagated should consider the collation of mapped column.
For example,

set collation = utf8_bin || set collation= utf8mb4_bin
where name='a' and length(name) = 1

The name = 'a' doesn't mean the all of column name data is 'a'. The 'a ' also can match the name='a' condition.
The reason is that 'utf8_bin' and 'utf8mb4_bin' are 'PAD SPACE' collation which means that it will ignore the trailing spaces.
**This kind of constant couldn't be propagated to 'Length' function. **

So I changed the columnSubstitute function to special due with 'length' function case.

Issue Number: close #53730

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.

Fix the error unexpected eliminated 'length()' conditions when collation is utf8_bin or utf8mb4_bin

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 24, 2024
Copy link

tiprow bot commented Jun 24, 2024

Hi @elsa0520. 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.

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 56.6355%. Comparing base (53901e8) to head (f71d777).
Report is 1053 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54179         +/-   ##
=================================================
- Coverage   74.5312%   56.6355%   -17.8958%     
=================================================
  Files          1515       1643        +128     
  Lines        360764     621235     +260471     
=================================================
+ Hits         268882     351840      +82958     
- Misses        72371     245827     +173456     
- Partials      19511      23568       +4057     
Flag Coverage Δ
integration 37.1190% <50.0000%> (?)
unit 71.8131% <91.6666%> (-1.5952%) ⬇️

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

Components Coverage Δ
dumpling 52.9656% <ø> (-2.2339%) ⬇️
parser ∅ <ø> (∅)
br 51.8234% <ø> (+7.8511%) ⬆️

@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Jun 26, 2024
@elsa0520
Copy link
Contributor Author

/test fast_test_tiprow

Copy link

ti-chi-bot bot commented Jun 26, 2024

@elsa0520: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pull-br-integration-test
  • /test pull-integration-ddl-test
  • /test pull-lightning-integration-test
  • /test pull-mysql-client-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test canary-notify-when-compatibility-sections-changed
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test
  • pingcap/tidb/pull_integration_ddl_test
  • pingcap/tidb/pull_mysql_client_test

In response to this:

/test fast_test_tiprow

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.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 26, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jun 26, 2024
Copy link

ti-chi-bot bot commented Jun 26, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-06-26 08:32:25.617259247 +0000 UTC m=+794872.102748079: ☑️ agreed by time-and-fate.
  • 2024-06-26 12:37:46.475511415 +0000 UTC m=+809592.961000247: ☑️ agreed by qw4990.

@winoros
Copy link
Member

winoros commented Jun 26, 2024

/retest

Copy link

tiprow bot commented Jun 26, 2024

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

Test name Commit Details Required Rerun command
fast_test_tiprow f71d777 link true /test fast_test_tiprow

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-sigs/prow repository. I understand the commands that are listed here.

@hawkingrei hawkingrei requested a review from XuHuaiyu June 27, 2024 03:17
Copy link

ti-chi-bot bot commented Jun 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qw4990, time-and-fate, 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 the approved label Jun 27, 2024
@ti-chi-bot ti-chi-bot bot merged commit 521c999 into pingcap:master Jun 27, 2024
22 of 23 checks passed
@ti-chi-bot ti-chi-bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Jul 1, 2024
@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 Jul 1, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 1, 2024
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

ti-chi-bot bot pushed a commit that referenced this pull request Jul 4, 2024
@ti-chi-bot ti-chi-bot removed the needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. label Jul 4, 2024
@winoros
Copy link
Member

winoros commented Jul 31, 2024

/cherrypick release-8.1

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 31, 2024
@ti-chi-bot
Copy link
Member

@winoros: new pull request created to branch release-8.1: #55108.

In response to this:

/cherrypick release-8.1

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 ti-community-infra/tichi repository.

elsa0520 added a commit to ti-chi-bot/tidb that referenced this pull request Aug 1, 2024
ti-chi-bot bot pushed a commit that referenced this pull request Aug 1, 2024
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. label Oct 30, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Oct 30, 2024
@ti-chi-bot
Copy link
Member

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

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-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. ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected eliminated conditions in the connection with utf8mb4 charset
7 participants