summaryrefslogtreecommitdiff
path: root/mysql-test/t/foreign_key.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-03-10 15:39:02 +0200
committerMichael Widenius <monty@askmonty.org>2010-03-10 15:39:02 +0200
commit77afc2be46e0a815357795a0ab0977115c8a313d (patch)
tree9073744695c84278cfca2d72d6422c09a00ea72e /mysql-test/t/foreign_key.test
parent292f6568fa377420c81e0317a26b804057ce208c (diff)
downloadmariadb-git-77afc2be46e0a815357795a0ab0977115c8a313d.tar.gz
Fix for: Bug#44987 DELETE IGNORE and FK constraint
- Now DELETE IGNORE skips over rows with a foreign key constraints (as it was supposed to do) mysql-test/r/foreign_key.result: Test case for Bug#44987 DELETE IGNORE and FK constraint mysql-test/t/foreign_key.test: Test case for Bug#44987 DELETE IGNORE and FK constraint sql/sql_delete.cc: Firx for Bug#44987 DELETE IGNORE and FK constraint Now DELETE IGNORE skips over rows with a foreign key constraints (as it was supposed to do) Bug fix inspired by: Moritz Mertinkat
Diffstat (limited to 'mysql-test/t/foreign_key.test')
-rw-r--r--mysql-test/t/foreign_key.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/mysql-test/t/foreign_key.test b/mysql-test/t/foreign_key.test
index 0a3708e6dc8..e71d4494d31 100644
--- a/mysql-test/t/foreign_key.test
+++ b/mysql-test/t/foreign_key.test
@@ -2,8 +2,10 @@
# Test syntax of foreign keys
#
+-- source include/have_innodb.inc
+
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
create table t1 (
@@ -23,3 +25,23 @@ create unique index b on t1 (a,b);
drop table t1;
# End of 4.1 tests
+
+#
+# Test DELETE IGNORE
+# Bug#44987 DELETE IGNORE and FK constraint
+#
+
+create table t1 (id int primary key) engine = innodb;
+create table t2 (id int PRIMARY KEY, FOREIGN KEY (id) REFERENCES t1(id)) engine=innodb;
+insert into t1 values (1), (2), (3), (4), (5), (6);
+insert into t2 values (3), (5);
+
+--error 1451
+delete from t1;
+select * from t1;
+
+delete ignore from t1;
+select row_count();
+select * from t1;
+drop table t2;
+drop table t1;