Commit 31d0d6e5 authored by unknown's avatar unknown

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
parent 6e13c4e2
...@@ -678,16 +678,17 @@ row_ins_foreign_check_on_constraint( ...@@ -678,16 +678,17 @@ row_ins_foreign_check_on_constraint(
} }
} }
/* We do not allow cyclic cascaded updating of the same /* We do not allow cyclic cascaded updating of the same table, except
table. Check that we are not updating the same table which in the case the update is the action of ON DELETE SET NULL, which
is already being modified in this cascade chain. We have to cannot lead to an infinite cycle. Check that we are not updating the
check this because the modification of the indexes of a same table which is already being modified in this cascade chain. We
'parent' table may still be incomplete, and we must avoid have to check this because the modification of the indexes of a
seeing the indexes of the parent table in an inconsistent 'parent' table may still be incomplete, and we must avoid seeing the
state! In this way we also prevent possible infinite indexes of the parent table in an inconsistent state! In this way we
update loops caused by cyclic cascaded updates. */ also prevent possible infinite update loops caused by cyclic cascaded
updates. */
if (!cascade->is_delete
if (!node->is_delete
&& row_ins_cascade_ancestor_updates_table(cascade, table)) { && row_ins_cascade_ancestor_updates_table(cascade, table)) {
/* We do not know if this would break foreign key /* We do not know if this would break foreign key
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment