Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
set foreign_key_checks=off;
create table child (id int,pid_test int,foreign key (pid_test) references parent(pid));
alter table child change column pid_test pid varchar(10);
2. What did you expect to see? (Required)
The foreign key is updated from pid_test to pid.
3. What did you see instead (Required)
mysql> show create table child;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| child | CREATE TABLE `child` (
`id` int(11) DEFAULT NULL,
`pid` varchar(10) DEFAULT NULL,
KEY `fk_1` (`pid`),
CONSTRAINT `fk_1` FOREIGN KEY (`pid_test`) REFERENCES `test`.`parent` (`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from information_schema.key_column_usage;
ERROR 1105 (HY000): runtime error: invalid memory address or nil pointer dereference
4. What is your TiDB version? (Required)
v6.5.6 and above
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
set foreign_key_checks=off;
create table child (id int,pid_test int,foreign key (pid_test) references parent(pid));
alter table child change column pid_test pid varchar(10);
2. What did you expect to see? (Required)
The foreign key is updated from
pid_testtopid.3. What did you see instead (Required)
4. What is your TiDB version? (Required)
v6.5.6 and above