Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.4.13, 10.4(EOL), 10.5
-
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
-
Activity
Field | Original Value | New Value |
---|---|---|
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 {code:mysql} 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; {code} |
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+ {code:mysql} 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; {code} |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] |
Component/s | Storage Engine - InnoDB [ 10129 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Assignee | Marko Mäkelä [ marko ] |
Link |
This issue is duplicated by |
Labels | regression |
Priority | Major [ 3 ] | Critical [ 2 ] |
Assignee | Marko Mäkelä [ marko ] | Alexander Barkov [ bar ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Alexander Barkov [ bar ] | Oleksandr Byelkin [ sanja ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Alexander Barkov [ bar ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
issue.field.resolutiondate | 2021-04-07 17:46:15.0 | 2021-04-07 17:46:15.366 |
Fix Version/s | 10.4.19 [ 25205 ] | |
Fix Version/s | 10.5.10 [ 25204 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 109390 ] | MariaDB v4 [ 157892 ] |