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, executor: allow insert strings with overflowed trailing spaces #20987

Merged
merged 13 commits into from
Nov 24, 2020

Conversation

ichn-hu
Copy link
Contributor

@ichn-hu ichn-hu commented Nov 11, 2020

What problem does this PR solve?

Issue Number: close #10392

Problem Summary:

For now, TiDB will complain with error if string inserted are longer than varchar or char's lenght constraint with trailing spaces, however, as in MySQL's doc

For VARCHAR columns, trailing spaces in excess of the column length are truncated prior to insertion and a warning is generated, regardless of the SQL mode in use. For CHAR columns, truncation of excess trailing spaces from inserted values is performed silently regardless of the SQL mode.

https://dev.mysql.com/doc/refman/8.0/en/char.html

What is changed and how it works?

Make overflowed trailing spaces trimed, and report warning for varchar.

Proposal: xxx

What's Changed:

How it Works:

Related changes

  • Need to cherry-pick to the release branch 4.0, 3.0.

Check List

Tests

  • Integration test

Side effects

N/A

Release note

  • No release note

@ichn-hu ichn-hu requested a review from a team as a code owner November 11, 2020 08:38
@ichn-hu ichn-hu requested review from wshwsh12 and removed request for a team November 11, 2020 08:38
@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 11, 2020

/reward 300

@ti-challenge-bot
Copy link

You are not the mentor for the linked issue.

@ichn-hu ichn-hu mentioned this pull request Nov 11, 2020
@ichn-hu ichn-hu force-pushed the fix-10392 branch 2 times, most recently from 8960f12 to b123478 Compare November 11, 2020 11:44
@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 11, 2020

/run-all-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/run-all-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/run-all-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/run-integration-ddl-test

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/run-unit-test

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/cc @XuHuaiyu PTAL

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/cc @XuHuaiyu

@ti-srebot ti-srebot requested a review from XuHuaiyu November 13, 2020 06:52
@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 13, 2020

/run-all-tests

Copy link
Contributor

@wshwsh12 wshwsh12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rest LGTM

types/datum.go Outdated Show resolved Hide resolved
@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 17, 2020

@wshwsh12 PTALA

Copy link
Contributor

@wshwsh12 wshwsh12 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 Nov 17, 2020
@XuHuaiyu
Copy link
Contributor

/reward 300

@ti-challenge-bot
Copy link

This PR's linked issue is not picked.

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 17, 2020

@XuHuaiyu I picked up the original issue, please reward again.

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

@XuHuaiyu PTALA

Copy link
Contributor

@XuHuaiyu XuHuaiyu 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 Nov 24, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 24, 2020
@XuHuaiyu
Copy link
Contributor

/merge

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

/run-all-tests

@ti-srebot
Copy link
Contributor

@ichn-hu merge failed.

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

/run-all-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

/run-all-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

/run-unit-tests

1 similar comment
@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

/run-unit-tests

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 24, 2020

/run-all-tests

@lzmhhh123 lzmhhh123 merged commit 83c1652 into pingcap:master Nov 24, 2020
@ti-challenge-bot
Copy link

@ichn-hu, Congratulations, you get 300 in this PR, and your total score is 300 in high-performance challenge program.

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 25, 2020

/label need-cherry-pick-4.0

@ti-srebot
Copy link
Contributor

These labels are not found need-cherry-pick-4.0.

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 25, 2020

/label needs-cherry-pick-4.0

@ichn-hu
Copy link
Contributor Author

ichn-hu commented Nov 25, 2020

/run-cherry-pick

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 25, 2020
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #21282

ti-srebot added a commit that referenced this pull request Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression sig/execution SIG execution status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatible with MySQL 8.0 about insert over length string into CHAR column
5 participants