diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-04-16 22:50:12 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-04-16 22:50:12 +0300 |
commit | 31d0d6e5bddcc4394a2bfd0320d3f01203146530 (patch) | |
tree | b630236d15e2cb2b38f7771661e6cf2c30b26467 /innobase | |
parent | 6e13c4e255824970c12a5772a5ee38310d98b229 (diff) | |
download | mariadb-git-31d0d6e5bddcc4394a2bfd0320d3f01203146530.tar.gz |
row0ins.c:
Fix bug: we did not allow ON DELETE SET NULL to modify the same table where the delete was made; we can allow it because that cannot produce infinite loops cascaded operations
innobase/row/row0ins.c:
Fix bug: we did not allow ON DELETE SET NULL to modify the same table where the delete was made; we can allow it because that cannot produce infinite loops cascaded operations
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0ins.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 1a616b74756..611f5cd30d1 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -678,16 +678,17 @@ row_ins_foreign_check_on_constraint( } } - /* We do not allow cyclic cascaded updating of the same - table. Check that we are not updating the same table which - is already being modified in this cascade chain. We have to - check this because the modification of the indexes of a - 'parent' table may still be incomplete, and we must avoid - seeing the indexes of the parent table in an inconsistent - state! In this way we also prevent possible infinite - update loops caused by cyclic cascaded updates. */ - - if (!cascade->is_delete + /* We do not allow cyclic cascaded updating of the same table, except + in the case the update is the action of ON DELETE SET NULL, which + cannot lead to an infinite cycle. Check that we are not updating the + same table which is already being modified in this cascade chain. We + have to check this because the modification of the indexes of a + 'parent' table may still be incomplete, and we must avoid seeing the + indexes of the parent table in an inconsistent state! In this way we + also prevent possible infinite update loops caused by cyclic cascaded + updates. */ + + if (!node->is_delete && row_ins_cascade_ancestor_updates_table(cascade, table)) { /* We do not know if this would break foreign key |