Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.11.7, 11.3.2, 10.11.8, 11.4.2
-
MariaDB-deb12
Description
Testcase with 2 tables
create table tab1 ( |
t1id int unsigned not null auto_increment, |
t1val varchar(30) not null, |
constraint pkt1 primary key (t1id) |
);
|
create table tab2 ( |
t2id int unsigned not null auto_increment, |
t1id int unsigned, |
t2tval datetime,
|
t2nval int, |
constraint pkt2 primary key (t2id) |
);
|
alter table tab2 add index FkIdxt2t1id (t1id), add constraint Fkt2t1id foreign key (t1id) references tab1 (t1id); |
Altering columns in one statement failes
alter table tab2 modify t1id int unsigned not null, modify t2tval timestamp(3), modify t2nval bigint; |
Cannot change column 't1id': used in a foreign key constraint 'Fkt2t1id'
|
alter not null in seperate statement works, also 2 modify data types
alter table tab2 modify t1id int unsigned not null; |
alter table tab2 modify t2tval timestamp(3), modify t2nval bigint; |
Attachments
Issue Links
- causes
-
MDEV-35351 Remove const from get_foreign_key_list/get_parent_foreign_key_list by merging 10.11 to 11.2
-
- Closed
-
-
MDEV-35445 Foreign key regression from 10.11.9 to 10.11.10 (and 11.4.4)
-
- Closed
-
- is caused by
-
MDEV-31086 MODIFY COLUMN can break FK constraints, and lead to unrestorable dumps
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue is caused by |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.4 [ 29301 ] | |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | |
Labels | regression | |
Priority | Minor [ 4 ] | Critical [ 2 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Description |
Testcase with 2 tables
{code:sql} reate table tab1 ( t1id int unsigned not null auto_increment, t1val varchar(30) not null, constraint pkt1 primary key (t1id) ); create table tab2 ( t2id int unsigned not null auto_increment, t1id int unsigned, t2tval datetime, t2nval int, constraint pkt2 primary key (t2id) ); alter table tab2 add index FkIdxt2t1id (t1id), add constraint Fkt2t1id foreign key (t1id) references tab1 (t1id); {code} Altering columns in one statement failes {code:sql}alter table tab2 modify t1id int unsigned not null, modify t2tval timestamp(3), modify t2nval bigint;{code} {noformat} Cannot change column 't1id': used in a foreign key constraint 'Fkt2t1id' {noformat} alter not null in seperate statement works, also 2 modify data types {code:sql}alter table tab2 modify t1id int unsigned not null; alter table tab2 modify t2tval timestamp(3), modify t2nval bigint;{code} |
Testcase with 2 tables
{code:sql} create table tab1 ( t1id int unsigned not null auto_increment, t1val varchar(30) not null, constraint pkt1 primary key (t1id) ); create table tab2 ( t2id int unsigned not null auto_increment, t1id int unsigned, t2tval datetime, t2nval int, constraint pkt2 primary key (t2id) ); alter table tab2 add index FkIdxt2t1id (t1id), add constraint Fkt2t1id foreign key (t1id) references tab1 (t1id); {code} Altering columns in one statement failes {code:sql}alter table tab2 modify t1id int unsigned not null, modify t2tval timestamp(3), modify t2nval bigint;{code} {noformat} Cannot change column 't1id': used in a foreign key constraint 'Fkt2t1id' {noformat} alter not null in seperate statement works, also 2 modify data types {code:sql}alter table tab2 modify t1id int unsigned not null; alter table tab2 modify t2tval timestamp(3), modify t2nval bigint;{code} |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | Marko Mäkelä [ marko ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Summary | alter foreign key column failed in combination 2nd modify column | Inplace algorithm violates the foreign key constraint |
Assignee | Marko Mäkelä [ marko ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Summary | Inplace algorithm violates the foreign key constraint | Nullability of the foreign key column fails to check foreign key constraint |
Summary | Nullability of the foreign key column fails to check foreign key constraint | Null-ability of the column fails to check foreign key constraint |
Summary | Null-ability of the column fails to check foreign key constraint | modification of the column fails to check foreign key constraint |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | Marko Mäkelä [ marko ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Assignee | Marko Mäkelä [ marko ] | Debarun Banerjee [ JIRAUSER54513 ] |
Assignee | Debarun Banerjee [ JIRAUSER54513 ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Affects Version/s | 11.4.2 [ 29633 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Fix Version/s | 10.5.27 [ 29902 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.4 [ 29301 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Fix Version/s | 10.6.20 [ 29903 ] | |
Fix Version/s | 10.11.10 [ 29904 ] | |
Fix Version/s | 11.2.6 [ 29906 ] | |
Fix Version/s | 11.4.4 [ 29907 ] |
Link |
This issue causes |
Link |
This issue includes |
Link |
This issue includes |
Link |
This issue causes |