Details
- 
    Bug 
- 
    Status: Closed (View Workflow)
- 
    Critical 
- 
    Resolution: Fixed
- 
    10.4.13, 10.4(EOL), 10.5(EOL)
- 
    Debian 10
Description
Changing the name of a primary key column with a foreign key constraint fails with the following error since 10.4.13:
[HY000][1553] (conn=17) Cannot drop index 'PRIMARY': needed in a foreign key constraint
| create schema test collate utf8_unicode_ci; | 
| create table test.input_type | 
| ( | 
|     input_type_id int(11) unsigned auto_increment | 
|         primary key | 
| ); | 
|  | 
| create table test.input | 
| ( | 
|     input_id int unsigned auto_increment | 
|         primary key, | 
|     input_type_id int unsigned not null, | 
|     constraint ibfk | 
|         foreign key (input_type_id) references test.input_type (input_type_id) | 
| ); | 
|  | 
| create index type_id | 
|     on test.input (input_type_id); | 
|  | 
| alter table test.input_type change input_type_id id int(11) unsigned auto_increment;
 | 
Attachments
Issue Links
- is duplicated by
- 
                    MDEV-23950 Renaming a column that is used as a foreign key throws an error -         
- Closed
 
-