diff options
Diffstat (limited to 'mysql-test/suite/pbxt/t/foreign_key.test')
-rw-r--r-- | mysql-test/suite/pbxt/t/foreign_key.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/suite/pbxt/t/foreign_key.test b/mysql-test/suite/pbxt/t/foreign_key.test new file mode 100644 index 00000000000..e9940e60d15 --- /dev/null +++ b/mysql-test/suite/pbxt/t/foreign_key.test @@ -0,0 +1,33 @@ +# +# Test syntax of foreign keys +# + +--disable_warnings +drop table if exists t1; +--enable_warnings + +set foreign_key_checks = 0; +# PBXT: added row c so I can test set null (not allowed on primary key) +create table t1 ( + a int not null references t2, + b int not null references t2 (c), + c int, + 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 (c) references t3 (e) on update set null); + +create index a on t1 (a); +create unique index b on t1 (a,b); +drop table t1; + +set foreign_key_checks = 1; + +--disable_query_log +drop database pbxt; +--enable_query_log +# End of 4.1 tests |