mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix Bug #57255 Cascade Delete results in "Got error -1 from storage engine".
rb://477 approved by Marko
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user