1. What did you do? ``` mysql> create table t4(col2 set('a\nb\tc\rd\0ef')); Query OK, 0 rows affected (0.00 sec) mysql> insert into t4(col2) values ('a\nb\tc\rd\0ef'); ERROR 1265 (01000): Data truncated for column 'col2' at row 1 mysql> insert into t4(col2) values ('a\nb\tc\rd'); Query OK, 1 row affected (0.00 sec) ``` 2. What did you expect to see? Just as above question's answer show. 3. What did you see instead? ``` mysql> create table t4(col2 set('a\nb\tc\rd\0ef')); Query OK, 0 rows affected (0.01 sec) mysql> insert into t4(col2) values ('a\nb\tc\rd\0ef'); Query OK, 1 row affected (0.00 sec) mysql> insert into t4(col2) values ('a\nb\tc\rd'); ERROR 1105 (HY000): cannot convert &{5 0 0 0 0 [97 10 98 9 99 13 100] <nil>} to type set ``` 4. What version of TiDB are you using (`tidb-server -V`)? ``` [root@devlop tidb]# ~/tidb-latest-linux-amd64/bin/tidb-server -V Release Version: 0.9.0 Git Commit Hash: 44f716fb1342bfe6427d9bca741e1c85a062ff94 Git Commit Branch: master UTC Build Time: 2017-09-03 01:14:50 [root@devlop tidb]# ```
Activity
XuHuaiyu commentedon Sep 6, 2017
@lkk2003rty This issue has been fixed?
lkk2003rty commentedon Sep 6, 2017
Not yet now. It was found this issue when I work in that PR. And I just refer this issue in that PR's conversation as one exception we need to fix.
wwar commentedon Apr 18, 2020
Confirming this issue is still present.
Pasteable test case:
Results:
bb7133 commentedon Nov 17, 2020
I think it is a bug of MySQL 5.7, probably because the C-styled string terminator is not handled properly and it has been fixed in MySQL 8:
The behavior is exactly the same as TiDB.
Although we claim that TiDB is compatible with 5.7, I still think we should not treat it as a bug nor "fix" it.
ti-srebot commentedon Nov 17, 2020
Please edit this comment or add a new comment to complete the following information
Not a bug
As what I stated above.