diff options
author | unknown <heikki@hundin.mysql.fi> | 2004-01-14 16:21:54 +0200 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2004-01-14 16:21:54 +0200 |
commit | d7c2c8f1f998cfff2ee39ce5aaa0a17920898ecf (patch) | |
tree | 432c3d1fdda484c8867c0e08d98aa7bef608a52a /innobase | |
parent | afa55213dcd1b146ff6dc987fad68081017d81ae (diff) | |
download | mariadb-git-d7c2c8f1f998cfff2ee39ce5aaa0a17920898ecf.tar.gz |
row0ins.c:
Fix bug: FOREIGN KEY ... ON UPDATE/DELETE NO ACTION must check the foreign key constraint, not ignore it. Peter Gulutzan said that NO ACTION should check the constraint as deferred, at the end of the SQL statement, while RESTRICT should check it immediately. Since we do not have defered constraints in InnoDB, this bug fix makes InnoDB to check NO ACTION constraints immediately, like it checks RESTRICT constraints.
innobase/row/row0ins.c:
Fix bug: FOREIGN KEY ... ON UPDATE/DELETE NO ACTION must check the foreign key constraint, not ignore it. Peter Gulutzan said that NO ACTION should check the constraint as deferred, at the end of the SQL statement, while RESTRICT should check it immediately. Since we do not have defered constraints in InnoDB, this bug fix makes InnoDB to check NO ACTION constraints immediately, like it checks RESTRICT constraints.
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0ins.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 45c5897eee7..d589cc8c9bc 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -682,14 +682,6 @@ row_ins_foreign_check_on_constraint( (DICT_FOREIGN_ON_DELETE_CASCADE | DICT_FOREIGN_ON_DELETE_SET_NULL))) { - /* No action is defined: return a foreign key error if - NO ACTION is not specified */ - - if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) { - - return(DB_SUCCESS); - } - row_ins_foreign_report_err((char*)"Trying to delete", thr, foreign, btr_pcur_get_rec(pcur), entry); @@ -703,14 +695,6 @@ row_ins_foreign_check_on_constraint( /* This is an UPDATE */ - /* No action is defined: return a foreign key error if - NO ACTION is not specified */ - - if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) { - - return(DB_SUCCESS); - } - row_ins_foreign_report_err((char*)"Trying to update", thr, foreign, btr_pcur_get_rec(pcur), entry); |