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

types,execute: fix errcode return like mysql when inserting incorrect int value #22432

Closed
wants to merge 4 commits into from

Conversation

erwadba
Copy link
Contributor

@erwadba erwadba commented Jan 19, 2021

What problem does this PR solve?

Issue Number: close #17832
Issue Number: close #22423

Problem Summary:

What is changed and how it works?

What's Changed:
1.Return ErrTruncatedWrongVal, when invalid string value convert to int in convert.go.
2.Handle the ErrTruncatedWrongVal about int type in handleErr func in insert_common.go
How it Works:

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
mysql> create table t(id int);
Query OK, 0 rows affected (0.15 sec)
mysql> insert into t values('1asf');
ERROR 1265 (01000): Data truncated for column 'id' at row 1
mysql>

Side effects

  • N/A

Release note

  • No release note

@erwadba erwadba requested a review from a team as a code owner January 19, 2021 05:08
@erwadba erwadba requested review from XuHuaiyu and removed request for a team January 19, 2021 05:08
@ichn-hu ichn-hu mentioned this pull request Jan 19, 2021
@erwadba
Copy link
Contributor Author

erwadba commented Jan 21, 2021

@ti-srebot /run-all-tests

@ti-srebot
Copy link
Contributor

/run-all-tests

@erwadba erwadba closed this Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants