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

rename index forgot to rename the virtual generated column #51431

Closed
lance6716 opened this issue Feb 29, 2024 · 0 comments · Fixed by #51984
Closed

rename index forgot to rename the virtual generated column #51431

lance6716 opened this issue Feb 29, 2024 · 0 comments · Fixed by #51984
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-7.6 component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

lance6716 commented Feb 29, 2024

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> create table t(j json);
Query OK, 0 rows affected (0.78 sec)

mysql> alter table t add index idx1((cast(j as char(10) array)));
Query OK, 0 rows affected (3.24 sec)

mysql> alter table t rename index idx1 to idx2;
Query OK, 0 rows affected (0.73 sec)

mysql> alter table t add index idx1((cast(j as char(10) array)));
ERROR 1060 (42S21): Duplicate column name '_V$_idx1_0'

mysql> show create table t;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                         |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `j` json DEFAULT NULL,
  KEY `idx2` ((cast(`j` as char(10) array)))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.20 sec)

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

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

@lance6716 lance6716 added the type/bug The issue is confirmed as a bug. label Feb 29, 2024
@seiya-annie seiya-annie added the component/ddl This issue is related to DDL of TiDB. label Mar 5, 2024
@lance6716 lance6716 changed the title rename index forgot to rename the virtual generated index rename index forgot to rename the virtual generated column Mar 5, 2024
@seiya-annie seiya-annie added affects-7.1 This bug affects the 7.1.x(LTS) versions. affects-7.5 This bug affects the 7.5.x(LTS) versions. labels Mar 5, 2024
@ywqzzy ywqzzy self-assigned this Mar 6, 2024
@ywqzzy ywqzzy added the affects-5.4 This bug affects the 5.4.x(LTS) versions. label Mar 21, 2024
@ti-chi-bot ti-chi-bot bot removed the may-affects-5.4 This bug maybe affects 5.4.x versions. label Mar 21, 2024
@ywqzzy ywqzzy added may-affects-5.4 This bug maybe affects 5.4.x versions. affects-6.1 This bug affects the 6.1.x(LTS) versions. labels Mar 21, 2024
@ywqzzy ywqzzy added may-affects-6.1 affects-6.5 This bug affects the 6.5.x(LTS) versions. labels Mar 21, 2024
@ywqzzy ywqzzy removed may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 labels Mar 21, 2024
ti-chi-bot bot pushed a commit that referenced this issue Apr 8, 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-7.6 component/ddl This issue is related to DDL of TiDB. severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants