-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.
Description
Bug Report
1. Minimal reproduce step (Required)
mysql> create table parent(id bigint(10) key);
Query OK, 0 rows affected (0.05 sec)
mysql> create table child(pid bigint(20), foreign key (pid) references parent(id));
Query OK, 0 rows affected (0.03 sec)
mysql> alter table child modify column pid bigint(1);
ERROR 1832 (HY000): Cannot change column 'pid': used in a foreign key constraint 'fk_1'
2. What did you expect to see? (Required)
mysql> create table parent(id bigint(10) key);
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> create table child(pid bigint(20), foreign key (pid) references parent(id));
Query OK, 0 rows affected, 1 warning (0.02 sec)
mysql> alter table child modify column pid bigint(1);
Query OK, 0 rows affected, 1 warning (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 1
3. What did you see instead (Required)
TiDB failed to alter table.
4. What is your TiDB version? (Required)
master 2482a6e
Metadata
Metadata
Assignees
Labels
component/ddlThis issue is related to DDL of TiDB.This issue is related to DDL of TiDB.severity/moderatetype/bugThe issue is confirmed as a bug.The issue is confirmed as a bug.