Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
11.4.2
-
None
-
11.4.2-MariaDB-deb12
Description
CREATE TABLE `tab1` ( |
`tab1id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`tab1desc` varchar(60) NOT NULL, |
PRIMARY KEY (`tab1id`) |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
 |
CREATE TABLE `tab2` ( |
`tab2id` int(10) unsigned NOT NULL AUTO_INCREMENT, |
`tab1id` int(10) unsigned DEFAULT NULL, |
`tab2desc` varchar(60) NOT NULL, |
PRIMARY KEY (`tab2id`), |
KEY `idxtab2tab1id` (`tab1id`), |
CONSTRAINT `fktab2tab1id` FOREIGN KEY (`tab1id`) REFERENCES `tab1` (`tab1id`) |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
dropping tab1id failed:
alter table tab2 drop COLUMN tab1id; |
Cannot drop index 'idxtab2tab1id': needed in a foreign key constraint
|
I can resolve by drop constraint first, but it is not fine