summaryrefslogtreecommitdiff
path: root/storage/innodb_plugin/row
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-11-03 16:09:17 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-11-03 16:09:17 +0200
commit7b2e07232a9307220187ee858c7c12a0d899d593 (patch)
tree72015dab42a49c01b928bb1243b9be81273453df /storage/innodb_plugin/row
parent39bceaac0295e556a8db5d354315b39dfb0f3ef6 (diff)
parent4cfa91f42c4cde9c35979cd2b9837cb60213d876 (diff)
downloadmariadb-git-7b2e07232a9307220187ee858c7c12a0d899d593.tar.gz
merge
Diffstat (limited to 'storage/innodb_plugin/row')
-rw-r--r--storage/innodb_plugin/row/row0mysql.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
index 827be32bdf7..609533c7647 100644
--- a/storage/innodb_plugin/row/row0mysql.c
+++ b/storage/innodb_plugin/row/row0mysql.c
@@ -1593,6 +1593,9 @@ row_update_cascade_for_mysql(
trx = thr_get_trx(thr);
+ /* Increment fk_cascade_depth to record the recursive call depth on
+ a single update/delete that affects multiple tables chained
+ together with foreign key relations. */
thr->fk_cascade_depth++;
if (thr->fk_cascade_depth > FK_MAX_CASCADE_DEL) {
@@ -1604,6 +1607,12 @@ run_again:
row_upd_step(thr);
+ /* The recursive call for cascading update/delete happens
+ in above row_upd_step(), reset the counter once we come
+ out of the recursive call, so it does not accumulate for
+ different row deletes */
+ thr->fk_cascade_depth = 0;
+
err = trx->error_state;
/* Note that the cascade node is a subnode of another InnoDB