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

Convert charset should consider index key length limitation #56930

Closed
tangenta opened this issue Oct 29, 2024 · 1 comment · Fixed by #56964
Closed

Convert charset should consider index key length limitation #56930

tangenta opened this issue Oct 29, 2024 · 1 comment · Fixed by #56964
Assignees
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. report/customer Customers have encountered this bug. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@tangenta
Copy link
Contributor

tangenta commented Oct 29, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

CREATE TABLE posts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  title VARCHAR(500) CHARACTER SET utf8mb4,
  subtitle VARCHAR(500) CHARACTER SET utf8mb4,
  UNIQUE KEY (title, subtitle)); 
ERROR 1071 (42000): Specified key was too long (4000 bytes); max key length is 3072 bytes

1. Minimal reproduce step (Required)

CREATE TABLE posts (
  id INT AUTO_INCREMENT PRIMARY KEY,
  title VARCHAR(500) CHARACTER SET utf8,
  subtitle VARCHAR(500) CHARACTER SET utf8,
  UNIQUE KEY (title, subtitle)); 

ALTER TABLE posts CONVERT TO CHARACTER SET utf8mb4;

2. What did you expect to see? (Required)

ERROR 1071 (42000): Specified key was too long (4000 bytes); max key length is 3072 bytes

3. What did you see instead (Required)

Query OK, 0 rows affected (0.07 sec)

4. What is your TiDB version? (Required)

cc37099

@tangenta tangenta added type/bug The issue is confirmed as a bug. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. severity/moderate labels Oct 29, 2024
@fzzf678
Copy link
Contributor

fzzf678 commented Oct 29, 2024

/assign

@jebter jebter added the component/ddl This issue is related to DDL of TiDB. label Oct 29, 2024
@ti-chi-bot ti-chi-bot bot added affects-6.5 This bug affects the 6.5.x(LTS) versions. report/customer Customers have encountered this bug. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.4 This bug affects the 5.4.x(LTS) versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. affects-6.5 This bug affects the 6.5.x(LTS) versions. affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. affects-8.1 This bug affects the 8.1.x(LTS) versions. component/ddl This issue is related to DDL of TiDB. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. report/customer Customers have encountered this bug. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants