You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
What did you do?
set names latin1;
drop table if exists t1;
create table t1(c varchar(1) not null, name varchar(64) not null) character set latin1;
insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
What did you expect to see?
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
Query OK, 1 row affected (0.01 sec)
What did you see instead?
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.08 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
ERROR 1366 (HY000): Incorrect value
What version of TiDB are you using (tidb-server -V)?
The text was updated successfully, but these errors were encountered:
MySQL [test]> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.31 sec)
MySQL [test]> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
ERROR 1366 (HY000): incorrect utf8 value c0(�) for column c
MySQL [test]> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-98-gd65ce86
Git Commit Hash: d65ce8655cd26bb5ec44f9239562013af692d2fa
Git Branch: master
UTC Build Time: 2018-10-24 08:22:37
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
The original testcase is dependent on what the default character set is:
createtablet1(c varchar(1) not null, name varchar(64) not null);
insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
It is sucessful in MySQL 5.7 (where it's latin1) but fails on MySQL 8.0 (where it is utf8mb4). I have updated the testcase to be consistent as:
set names latin1;
droptable if exists t1;
createtablet1(c varchar(1) not null, name varchar(64) not null) character set latin1;
insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
This testcase executes successfully on MySQL 5.7/8.0 and TiDB, so I am going to go ahead and close this bug.
Please answer these questions before submitting your issue. Thanks!
tidb-server -V
)?The text was updated successfully, but these errors were encountered: