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

server: handle the case the type of param is set for the param sent by SEND_LONG_DATA #52720

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

YangKeao
Copy link
Member

@YangKeao YangKeao commented Apr 18, 2024

What problem does this PR solve?

Issue Number: close #52711

After sending the param through SEND_LONG_DATA, it's still possible that the type is given in the EXECUTE statement. But actually I'm not sure whether every client sends the type, so I kept the original behavior if the type is not sent to keep compatibility.

What changed and how does it work?

Assert whether the type is sent in EXECUTE statement. If it's sent, use the given type. If it's not sent, still use the Blob` to keep compatible with the original behavior.

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.

I tried to run the program https://gist.github.com/YangKeao/51bbc88600c69691a799227806f32cd5 on TiDB.

Before this PR, the data in table t after running this program is

| utf8     | "你好"      | "你好"                            | 0x22E4BDA0E5A5BD22       |
| utf8     | "你好"      | "base64:type252:IuS9oOWlvSI="     | 0x22E4BDA0E5A5BD22       |
| gbk      | "浣犲ソ"    | "浣犲ソ"                          | 0x22E4BDA0E5A5BD22       |
| gbk      | "浣犲ソ"    | "base64:type252:Iua1o+eKsuOCvSI=" | 0x22E6B5A3E78AB2E382BD22 |

After this PR, the data in table t after running this program is

| utf8     | "你好"      | "你好"                            | 0x22E4BDA0E5A5BD22       |
| utf8     | "你好"      | "你好"                            | 0x22E4BDA0E5A5BD22       |
| gbk      | "浣犲ソ"    | "浣犲ソ"                          | 0x22E4BDA0E5A5BD22       |
| gbk      | "浣犲ソ"    | "浣犲ソ"                          | 0x22E4BDA0E5A5BD22       |

Running this program in MySQL, will get:

| utf8     | "你好"      | "你好"      | 0x22E4BDA0E5A5BD22 |
| utf8     | "你好"      | "你好"      | 0x22E4BDA0E5A5BD22 |
| gbk      | "浣犲ソ"    | "浣犲ソ"    | 0x22E4BDA0E5A5BD22 |
| gbk      | "浣犲ソ"    | "浣犲ソ"    | 0x22E4BDA0E5A5BD22 |

Which is the same as what we got with this PR.

I'll try to add this manual test to mysqlclienttest later 🤔 .

Release note

Fix the issue that param transfered by `SEND_LONG_DATA` is always regarded as `Blob` type.

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed 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. labels Apr 18, 2024
Copy link

codecov bot commented Apr 18, 2024

Codecov Report

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

Project coverage is 74.6173%. Comparing base (ecb8a9e) to head (db2abf1).
Report is 50 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52720        +/-   ##
================================================
+ Coverage   72.3357%   74.6173%   +2.2816%     
================================================
  Files          1471       1481        +10     
  Lines        427132     437590     +10458     
================================================
+ Hits         308969     326518     +17549     
+ Misses        98881      91036      -7845     
- Partials      19282      20036       +754     
Flag Coverage Δ
integration 49.2281% <0.0000%> (?)
unit 71.1940% <95.8333%> (-0.0332%) ⬇️

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

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

@YangKeao
Copy link
Member Author

/hold

Need more tests

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 18, 2024
@YangKeao YangKeao added compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) and removed compatibility-mysql8 This is a compatibility issue with MySQL 8.0(but NOT 5.7) labels Apr 23, 2024
@ti-chi-bot ti-chi-bot bot removed the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 23, 2024
@YangKeao
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 23, 2024
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 24, 2024
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 24, 2024
Copy link

ti-chi-bot bot commented Apr 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lcwangchao, xhebox

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 Apr 25, 2024
Copy link

ti-chi-bot bot commented Apr 25, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-24 07:53:05.687466229 +0000 UTC m=+160342.427369141: ☑️ agreed by lcwangchao.
  • 2024-04-25 02:41:06.647913135 +0000 UTC m=+228023.387816046: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot merged commit 24990b5 into pingcap:master Apr 25, 2024
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 May 7, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 7, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@ti-chi-bot
Copy link
Member

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

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.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 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.

The type of the param sent through SEND_LONG_DATA is not set according to the request
4 participants