summaryrefslogtreecommitdiff
path: root/mysql-test/main/alter_table.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/alter_table.result')
-rw-r--r--mysql-test/main/alter_table.result49
1 files changed, 49 insertions, 0 deletions
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 92946b65e66..5ae90459ff4 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -2468,6 +2468,55 @@ ERROR 23000: Duplicate entry '1' for key 'i'
UNLOCK TABLES;
DROP TABLE t1;
#
+# MDEV-17599 ALTER TABLE DROP CONSTRAINT does not work for foreign keys.
+#
+CREATE TABLE t1(id INT PRIMARY KEY, c1 INT) ENGINE= INNODB;
+CREATE TABLE t2(id INT PRIMARY KEY, c1 INT, c2 INT NOT NULL,
+CONSTRAINT sid FOREIGN KEY (`c1`) REFERENCES t1 (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
+CONSTRAINT UNIQUE `ui`(c2)) ENGINE= INNODB;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `ui` (`c2`),
+ KEY `sid` (`c1`),
+ CONSTRAINT `sid` FOREIGN KEY (`c1`) REFERENCES `t1` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t2 DROP CONSTRAINT sid;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `ui` (`c2`),
+ KEY `sid` (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t2 DROP CONSTRAINT ui;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `sid` (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ALTER TABLE t2 DROP CONSTRAINT PRIMARY KEY;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `c1` int(11) DEFAULT NULL,
+ `c2` int(11) NOT NULL,
+ KEY `sid` (`c1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t2, t1;
+#
# End of 10.2 tests
#
#