summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJimmy Yang <jimmy.yang@oracle.com>2010-10-06 07:58:12 -0700
committerJimmy Yang <jimmy.yang@oracle.com>2010-10-06 07:58:12 -0700
commit8e035295025cfb1b56cde182fe77cc8aeeaa93e9 (patch)
treef4f6bb0dfe473690d1b39a6504de4842100a91fa /storage
parentc0923d396aef46799883390e9dcf7bbf173e4a03 (diff)
parent34c61d04482dcf558102db89f9896d894c617ae3 (diff)
downloadmariadb-git-8e035295025cfb1b56cde182fe77cc8aeeaa93e9.tar.gz
Merge from mysql-5.1-security to mysql-5.5-security
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/row/row0mysql.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index e0f85b3ebb4..3e155fd14e6 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -1652,6 +1652,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) {
@@ -1663,6 +1666,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