-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Incompatible with MySQL 8.0 about insert over length string into CHAR
column
#10392
Comments
Confirming this bug still exists in master (you don't need to change TiDB's sql modes - the original testcase is unclear there): drop table if exists vctt;
create table vctt (v varchar(4), c char(4));
insert into vctt values ("ab ", "ab ");
..
mysql> insert into vctt values ("ab ", "ab ");
ERROR 1406 (22001): Data too long for column 'c' at row 1
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-750-g8a661044c
Edition: Community
Git Commit Hash: 8a661044cedf8daad1de4fbf79a390962b6f6c3b
Git Branch: master
UTC Build Time: 2020-07-10 10:52:37
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
duplicated with #4323 |
I think it's a compatibility problem. TiDB truncates the tailing spaces, insert "ab "(three tail spaces) to char(4) is ok. But MySQL would pads "ab " to char(4), then fails. @nullnotnil What do you think about this? Should we need to fix it? |
Yes, I don't think it is high priority, but I expect there could be applications that depend on this. |
Ok, I hope some contributors can help us with this issue. It's not hard to fix. |
/assign @ichn-hu |
/pick-up |
Pick up success. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
Truncate over length string successfully.
Got error
Error 1406: Data too long for column 'c' at row 1
tidb-server -V
or runselect tidb_version();
on TiDB)?SIG slack channel
#sig-exec
Score
Mentor
The text was updated successfully, but these errors were encountered: