Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL)
-
None
Description
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB; |
--error ER_CANT_DROP_FIELD_OR_KEY
|
ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=COPY; |
|
# Cleanup
|
DROP TABLE t1; |
10.5 8c0b9880 |
query 'ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=COPY' failed with wrong errno 1025: 'Error on rename of './test/t1' to './test/#sql2-10fa-4' (errno: 152 "Cannot delete a parent row")', instead of 1091...
|
Without ALGORITHM=COPY it fails with ER_CANT_DROP_FIELD_OR_KEY as expected.
There is an ancient upstream bug https://bugs.mysql.com/bug.php?id=14347 which seems related, but I'm not sure it's quite the same.
Attachments
Issue Links
- relates to
-
MDEV-28904 DROP CONSTRAINT ..., ALGORITHM=COPY has no effect
-
- Stalled
-
-
MDEV-20480 Obsolete internal parser for FK in InnoDB
-
- Closed
-
-
MDEV-22232 Server crashes in rpl_sql_thread_info::cached_charset_compare / wsrep_apply_events
-
- Closed
-
- links to
Activity
Field | Original Value | New Value |
---|---|---|
Remote Link | This issue links to "Bug #14347 Can't remove FOREIGN KEY (Web Link)" [ 29509 ] |
Link |
This issue relates to |
Assignee | Oleksandr Byelkin [ sanja ] | Aleksey Midenkov [ midenok ] |
Comment | [ A comment with security level 'Developers' was removed. ] |
Workflow | MariaDB v3 [ 107076 ] | MariaDB v4 [ 141880 ] |
Assignee | Aleksey Midenkov [ midenok ] | Jan Lindström [ jplindst ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Link | This issue relates to MDEV-28904 [ MDEV-28904 ] |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Assignee | Jan Lindström [ jplindst ] | Alexey Botchkov [ holyfoot ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.9 [ 26905 ] | |
Affects Version/s | 10.10 [ 27530 ] | |
Affects Version/s | 10.11 [ 27614 ] | |
Affects Version/s | 11.0 [ 28320 ] | |
Affects Version/s | 11.1 [ 28549 ] |
Link |
This issue relates to |
Fix Version/s | 11.2 [ 28603 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Assignee | Alexey Botchkov [ holyfoot ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Thirunarayanan Balathandayuthapani [ thiru ] | Marko Mäkelä [ marko ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Marko Mäkelä [ marko ] | Thirunarayanan Balathandayuthapani [ thiru ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.4.33 [ 29516 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Fix Version/s | 10.5.24 [ 29517 ] | |
Fix Version/s | 10.6.17 [ 29518 ] | |
Fix Version/s | 10.11.7 [ 29519 ] | |
Fix Version/s | 11.0.5 [ 29520 ] | |
Fix Version/s | 11.1.4 [ 29024 ] | |
Fix Version/s | 11.2.3 [ 29521 ] |
While testing my fix I noticed that DROP CONSTRAINT ..., ALGORITHM=COPY has no effect. If you remove ALGORITHM it works as expected.
CREATE TABLE t1 (a INT primary key, b int) ENGINE=InnoDB;
CREATE TABLE t2 (a int primary key, b int, constraint b foreign key (b) references t1(a)) engine=innodb;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`),
CONSTRAINT `b` FOREIGN KEY (`b`) REFERENCES `t1` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
ALTER TABLE t2 DROP CONSTRAINT b, ALGORITHM=COPY;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`),
CONSTRAINT `b` FOREIGN KEY (`b`) REFERENCES `t1` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1