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 charset conversion warning and error behavior #51191

Merged
merged 1 commit into from
May 13, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Feb 20, 2024

What problem does this PR solve?

Issue Number: close #50295

Problem Summary:

The error cannotConvertString should have three different behaviors:

  1. Explicit cast, and SQL_MODE is strict: it'll return NULL and add a warning.
  2. Explicit cast, and SQL_MODE is not strict: it'll return truncated string and add a warning.
  3. Implicit cast: it'll return an error.

TiDB returns error in all cases, so it's not compatible.

What changed and how does it work?

Fix the behavior of from_binary function. Now it's only fixed on TiDB, and will need some modification on TiKV as well.

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

Copy link

ti-chi-bot bot commented Feb 20, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 20, 2024
Copy link

tiprow bot commented Feb 20, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 20, 2024
@YangKeao
Copy link
Member Author

/retest

@YangKeao
Copy link
Member Author

/retest

@YangKeao
Copy link
Member Author

/retest

Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 74.1593%. Comparing base (601e21c) to head (f0a66f0).
Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #51191        +/-   ##
================================================
+ Coverage   72.4105%   74.1593%   +1.7488%     
================================================
  Files          1492       1492                
  Lines        429312     429505       +193     
================================================
+ Hits         310867     318518      +7651     
+ Misses        99145      91098      -8047     
- Partials      19300      19889       +589     
Flag Coverage Δ
integration 47.6690% <71.8750%> (?)
unit 71.2358% <56.2500%> (-0.0632%) ⬇️

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

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

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 29, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 28, 2024
@YangKeao
Copy link
Member Author

YangKeao commented May 8, 2024

/retest

@YangKeao YangKeao marked this pull request as ready for review May 10, 2024 05:09
@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/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/needs-triage-completed labels May 10, 2024
@YangKeao YangKeao changed the title parser, expression: fix charset conversion warning and error behavior expression: fix charset conversion warning and error behavior May 10, 2024
@YangKeao
Copy link
Member Author

/retest

2 similar comments
@YangKeao
Copy link
Member Author

/retest

@YangKeao
Copy link
Member Author

/retest

Copy link

ti-chi-bot bot commented May 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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 May 11, 2024
Copy link

ti-chi-bot bot commented May 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-11 06:36:44.752260832 +0000 UTC m=+1289558.509396406: ☑️ agreed by zanmato1984.
  • 2024-05-11 08:55:04.226530729 +0000 UTC m=+1297857.983666299: ☑️ agreed by Defined2014.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 13, 2024
@ti-chi-bot ti-chi-bot bot merged commit 4674b12 into pingcap:master May 13, 2024
22 of 23 checks passed
@YangKeao YangKeao added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label May 13, 2024
@ti-chi-bot
Copy link
Member

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

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

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

@ti-chi-bot
Copy link
Member

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

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

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 22, 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. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. release-note-none Denotes a PR that doesn't merit a release note. 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.

TiDB 7.5 Cannot convert string with utf8mb4
4 participants