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

Field length limit #24288

Closed
linhantao opened this issue Apr 26, 2021 · 9 comments · Fixed by #24337
Closed

Field length limit #24288

linhantao opened this issue Apr 26, 2021 · 9 comments · Fixed by #24337
Labels
type/bug This issue is a bug.

Comments

@linhantao
Copy link

linhantao commented Apr 26, 2021

When migrating from MySQL data, you can create a maximum of 21 Chinese characters when creating fields in Chinese.
Not fully compatible with MySQL.
Mysql supports Column creation with 64 characters
The official documentation says the maximum is 64 bits

image

image
image

@linhantao linhantao added the type/bug This issue is a bug. label Apr 26, 2021
@dveeden
Copy link
Contributor

dveeden commented Apr 27, 2021

The official documentation says the maximum is 64 bits

Isn't that bytes?

@dveeden
Copy link
Contributor

dveeden commented Apr 27, 2021

https://docs.pingcap.com/tidb/stable/tidb-limitations says the limit is 64 characters
image

@linhantao
Copy link
Author

@dveeden I am using Chinese characters, field creation failed

image
image

@dveeden
Copy link
Contributor

dveeden commented Apr 27, 2021

@linhantao Yes that should work according to the docs, so that's a bug that indeed affects MySQL Compatibility

@dveeden
Copy link
Contributor

dveeden commented Apr 27, 2021

mysql> create table t1 (id int primary key, `一二三四五六七八九十一二三四五六 
八九十一二三 四五六七八九十一二三四五六七八九十` varchar(255));
ERROR 1059 (42000): Identifier name '一二三四五六七八九十一二三四五六七八九十一二三 四五六七八九十一二三四五六七八九十' is too long
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.0.0
Edition: Community
Git Commit Hash: bdac0885cd11bdf571aad9353bfc24e13554b91c
Git Branch: heads/refs/tags/v5.0.0
UTC Build Time: 2021-04-06 16:36:29
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)
mysql 8.0.22 > create table t1 (id int primary key, `一二三四五六七八九十一二三四五六七八九十一二三 四五六七八九十一二三四五六七八九十` varchar(255));
Query OK, 0 rows affected (0.13 sec)

mysql 8.0.22 > show create table t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` int NOT NULL,
  `一二三四五六七八九十一二三四五六七八九十一二三 四五六七八九十一二三四五六七八九十` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)

mysql 8.0.22 > select version();
+-----------+
| version() |
+-----------+
| 8.0.22    |
+-----------+
1 row in set (0.00 sec)

@linhantao
Copy link
Author

linhantao commented Apr 27, 2021

@dveeden So will this be scheduled to be compatible? Fix the bug
Table length also has this problem

@dveeden
Copy link
Contributor

dveeden commented Apr 27, 2021

#24283 is related. This is probably an issue for all object names.

@linhantao
Copy link
Author

@dveeden yes.so When will the problem be fixed

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants