summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_plugin/t/innodb.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb_plugin/t/innodb.test')
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_plugin/t/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test
index aeddddaba28..03c8336f214 100644
--- a/mysql-test/suite/innodb_plugin/t/innodb.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb.test
@@ -1042,6 +1042,24 @@ update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id
update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
drop table t3,t2,t1;
+# test ON UPDATE CASCADE
+CREATE TABLE t1 (
+ c1 VARCHAR(8), c2 VARCHAR(8),
+ PRIMARY KEY (c1, c2)
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+ c0 INT PRIMARY KEY,
+ c1 VARCHAR(8) UNIQUE,
+ FOREIGN KEY (c1) REFERENCES t1 (c1) ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES ('old', 'somevalu'), ('other', 'anyvalue');
+INSERT INTO t2 VALUES (10, 'old'), (20, 'other');
+-- error ER_FOREIGN_DUPLICATE_KEY
+UPDATE t1 SET c1 = 'other' WHERE c1 = 'old';
+DROP TABLE t2,t1;
+
#
# test for recursion depth limit
#