diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-12 14:41:51 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-12-12 14:41:51 +0200 |
commit | 0a20e5ab77f8a6532b41ea2518626397059ccf42 (patch) | |
tree | 1ef90ec718bc16d80ca65eb89537f697e1482f09 /mysql-test/main/foreign_key.result | |
parent | e0f9540bcc6ab1618b6fd475f02e019401c4c295 (diff) | |
parent | beec9c0e19284a0e50d3629f4cb2486007b0333b (diff) | |
download | mariadb-git-0a20e5ab77f8a6532b41ea2518626397059ccf42.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/foreign_key.result')
-rw-r--r-- | mysql-test/main/foreign_key.result | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/main/foreign_key.result b/mysql-test/main/foreign_key.result index a82151ddec0..c412be6bbdb 100644 --- a/mysql-test/main/foreign_key.result +++ b/mysql-test/main/foreign_key.result @@ -82,3 +82,29 @@ add foreign key (a) references t3 (a) on update set default on update set default); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'update set default)' at line 3 drop table t_34455; +# +# MDEV-18460 Don't allow multiple table CONSTRAINTs with the same name. +# +CREATE TABLE tpk (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,name VARCHAR(100) NOT NULL) ENGINE=Innodb; +CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1), CONSTRAINT sid CHECK (c2>15)); +ERROR HY000: Duplicate CHECK constraint name 'sid' +CREATE TABLE tfk (c1 INT, c2 INT, CONSTRAINT sid UNIQUE (c1)); +ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15); +ERROR HY000: Duplicate CHECK constraint name 'sid' +DROP TABLE tfk; +CREATE TABLE tfk (c1 INT, c2 INT, +CONSTRAINT sid FOREIGN KEY (c1) REFERENCES tpk (id)) ENGINE=Innodb; +show create table tfk; +Table Create Table +tfk CREATE TABLE `tfk` ( + `c1` int(11) DEFAULT NULL, + `c2` int(11) DEFAULT NULL, + KEY `sid` (`c1`), + CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `tpk` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE tfk ADD CONSTRAINT sid CHECK (c2>15); +ERROR HY000: Duplicate CHECK constraint name 'sid' +ALTER TABLE tfk ADD CONSTRAINT sid UNIQUE(c2); +ERROR 42000: Duplicate key name 'sid' +DROP TABLE tfk; +DROP TABLE tpk; |