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

extended latin character set not support #3888

Closed
winkyao opened this issue Jul 25, 2017 · 2 comments
Closed

extended latin character set not support #3888

winkyao opened this issue Jul 25, 2017 · 2 comments

Comments

@winkyao
Copy link
Contributor

winkyao commented Jul 25, 2017

Please answer these questions before submitting your issue. Thanks!

  1. 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');
  1. 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)
  1. 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
  1. What version of TiDB are you using (tidb-server -V)?
@morgo
Copy link
Contributor

morgo commented Oct 28, 2018

Confirmed that this is still an issue:

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)

@ghost ghost added the component/charset label Jul 30, 2020
@morgo
Copy link
Contributor

morgo commented Dec 23, 2020

The original testcase is dependent on what the default character set is:

create table t1(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;
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');

This testcase executes successfully on MySQL 5.7/8.0 and TiDB, so I am going to go ahead and close this bug.

@morgo morgo closed this as completed Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants