summaryrefslogtreecommitdiff
path: root/mysql-test/t/foreign_key.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/foreign_key.test')
-rw-r--r--mysql-test/t/foreign_key.test20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test
new file mode 100644
index 00000000000..1afcb546f6a
--- /dev/null
+++ b/mysql-test/t/foreign_key.test
@@ -0,0 +1,20 @@
+#
+# Test syntax of foreign keys
+#
+
+drop table if exists t1;
+create table t1 (
+ a int not null references t2,
+ b int not null references t2 (c),
+ primary key (a,b),
+ foreign key (a) references t3 match full,
+ foreign key (a) references t3 match partial,
+ foreign key (a,b) references t3 (c,d) on delete no action
+ on update no action,
+ foreign key (a,b) references t3 (c,d) on update cascade,
+ foreign key (a,b) references t3 (c,d) on delete set default,
+ foreign key (a,b) references t3 (c,d) on update set null);
+
+create index a on t1 (a);
+create unique index b on t1 (a,b);
+drop table t1;