row0mysql.c, row0ins.c:
Fix bug #5961: release the dictionary latch during a long cascaded FOREIGN KEY operation, so that we do not starve other users innobase/row/row0ins.c: Fix bug #5961: release the dictionary latch during a long cascaded FOREIGN KEY operation, so that we do not starve other users innobase/row/row0mysql.c: Fix bug #5961: release the dictionary latch during a long cascaded FOREIGN KEY operation, so that we do not starve other users
This commit is contained in:
parent
ec8779e95a
commit
4f84f90f96
@ -966,6 +966,23 @@ row_ins_foreign_check_on_constraint(
|
|||||||
|
|
||||||
err = row_update_cascade_for_mysql(thr, cascade,
|
err = row_update_cascade_for_mysql(thr, cascade,
|
||||||
foreign->foreign_table);
|
foreign->foreign_table);
|
||||||
|
|
||||||
|
if (foreign->foreign_table->n_foreign_key_checks_running == 0) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"InnoDB: error: table %s has the counter 0 though there is\n"
|
||||||
|
"InnoDB: a FOREIGN KEY check running on it.\n",
|
||||||
|
foreign->foreign_table->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Release the data dictionary latch for a while, so that we do not
|
||||||
|
starve other threads from doing CREATE TABLE etc. if we have a huge
|
||||||
|
cascaded operation running. The counter n_foreign_key_checks_running
|
||||||
|
will prevent other users from dropping or ALTERing the table when we
|
||||||
|
release the latch. */
|
||||||
|
|
||||||
|
row_mysql_unfreeze_data_dictionary(thr_get_trx(thr));
|
||||||
|
row_mysql_freeze_data_dictionary(thr_get_trx(thr));
|
||||||
|
|
||||||
mtr_start(mtr);
|
mtr_start(mtr);
|
||||||
|
|
||||||
/* Restore pcur position */
|
/* Restore pcur position */
|
||||||
|
@ -2156,7 +2156,7 @@ row_drop_table_for_mysql(
|
|||||||
fputs(" InnoDB: You are trying to drop table ", stderr);
|
fputs(" InnoDB: You are trying to drop table ", stderr);
|
||||||
ut_print_name(stderr, table->name);
|
ut_print_name(stderr, table->name);
|
||||||
fputs("\n"
|
fputs("\n"
|
||||||
"InnoDB: though there are foreign key check running on it.\n"
|
"InnoDB: though there is a foreign key check running on it.\n"
|
||||||
"InnoDB: Adding the table to the background drop queue.\n",
|
"InnoDB: Adding the table to the background drop queue.\n",
|
||||||
stderr);
|
stderr);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user