summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb/r/fk_drop_alter.result
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /mysql-test/suite/innodb/r/fk_drop_alter.result
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb/r/fk_drop_alter.result')
-rw-r--r--mysql-test/suite/innodb/r/fk_drop_alter.result44
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/fk_drop_alter.result b/mysql-test/suite/innodb/r/fk_drop_alter.result
new file mode 100644
index 00000000..414f44f2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/fk_drop_alter.result
@@ -0,0 +1,44 @@
+#
+# MDEV-22230 : Unexpected ER_ERROR_ON_RENAME upon DROP
+# non-existing FOREIGN KEY
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=COPY;
+ERROR 42000: Can't DROP FOREIGN KEY `x`; check that it exists
+ALTER TABLE t1 DROP FOREIGN KEY x, ALGORITHM=INPLACE;
+ERROR 42000: Can't DROP FOREIGN KEY `x`; check that it exists
+DROP TABLE t1;
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT, FOREIGN KEY fk_id (a) REFERENCES t1(a))ENGINE=InnoDB;
+CREATE TABLE t3 (a INT, FOREIGN KEY fk_1 (a) REFERENCES t1(a))ENGINE=InnoDB;
+ALTER TABLE t3 DROP FOREIGN KEY IF EXISTS fk_id;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `fk_id`; check that it exists
+DROP TABLE t3, t2;
+ALTER TABLE t1 MODIFY COLUMN a VARCHAR(2), DROP FOREIGN KEY IF EXISTS x;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `x`; check that it exists
+DROP TABLE t1;
+CREATE DATABASE best;
+CREATE TABLE best.t1(f1 INT, KEY(f1))ENGINE=InnoDB;
+CREATE TABLE best.t2(f1 INT, FOREIGN KEY foo(f1) REFERENCES t1(f1))ENGINE=InnoDB;
+CREATE TABLE t1(f1 INT, KEY(f1))ENGINE=InnoDB;
+CREATE TABLE t2(f1 INT, FOREIGN KEY foo(f1) REFERENCES t1(f1))ENGINE=InnoDB;
+ALTER TABLE t2 DROP FOREIGN KEY foo;
+ALTER TABLE t2 DROP FOREIGN KEY foo;
+ERROR 42000: Can't DROP FOREIGN KEY `foo`; check that it exists
+ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS foo;
+Warnings:
+Note 1091 Can't DROP FOREIGN KEY `foo`; check that it exists
+SHOW CREATE TABLE best.t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` int(11) DEFAULT NULL,
+ KEY `foo` (`f1`),
+ CONSTRAINT `foo` FOREIGN KEY (`f1`) REFERENCES `t1` (`f1`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_FOREIGN;
+ID FOR_NAME REF_NAME N_COLS TYPE
+best/foo best/t2 best/t1 1 0
+DROP TABLE best.t2, best.t1, t2, t1;
+DROP DATABASE best;