summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h
index a1e7db36ced..35b0388afba 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -2026,6 +2026,9 @@ struct TABLE_LIST
OT_BASE_ONLY);
belong_to_view= belong_to_view_arg;
trg_event_map= trg_event_map_arg;
+ /* MDL is enough for read-only FK checks, we don't need the table */
+ if (prelocking_type == PRELOCK_FK && lock_type < TL_WRITE_ALLOW_WRITE)
+ open_strategy= OPEN_STUB;
**last_ptr= this;
prev_global= *last_ptr;