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
- is caused by
-
MDEV-31086 MODIFY COLUMN can break FK constraints, and lead to unrestorable dumps
- Closed