Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
MariaDB [test]> create table tfk (id INT, c1 INT, c2 INT NOT NULL, CONSTRAINT sid FOREIGN KEY (`c1`) REFERENCES tpk (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT sid check (c2>15)); |
Query OK, 0 rows affected (0.23 sec) |
 |
MariaDB [test]> show create table tfk; |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| tfk | CREATE TABLE `tfk` ( |
`id` int(11) DEFAULT NULL, |
`c1` int(11) DEFAULT NULL, |
`c2` int(11) NOT NULL, |
KEY `sid` (`c1`), |
CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `tpk` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, |
CONSTRAINT `sid` CHECK (`c2` > 15) |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | |
+-------+------------------------------------------------------------------------------------------- |
So two constraints with the same name 'sid' were created.