Commit 424210ab authored by Sergei Golubchik's avatar Sergei Golubchik

cleanup: reduce code duplication

parent cfa8268e
......@@ -4739,6 +4739,9 @@ prepare_fk_prelocking_list(THD *thd, Query_tables_list *prelocking_ctx,
Query_arena *arena, backup;
TABLE *table= table_list->table;
if (!table->file->referenced_by_foreign_key())
DBUG_RETURN(FALSE);
arena= thd->activate_stmt_arena_if_needed(&backup);
table->file->get_parent_foreign_key_list(thd, &fk_list);
......@@ -4824,16 +4827,12 @@ bool DML_prelocking_strategy::handle_table(THD *thd,
return TRUE;
}
if (table->file->referenced_by_foreign_key())
{
if (prepare_fk_prelocking_list(thd, prelocking_ctx, table_list,
need_prelocking,
table_list->trg_event_map))
return TRUE;
}
if (prepare_fk_prelocking_list(thd, prelocking_ctx, table_list,
need_prelocking,
table_list->trg_event_map))
return TRUE;
}
else if (table_list->slave_fk_event_map &&
table->file->referenced_by_foreign_key())
else if (table_list->slave_fk_event_map)
{
if (prepare_fk_prelocking_list(thd, prelocking_ctx, table_list,
need_prelocking,
......
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