summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-05-09 20:25:21 +0200
committerSergei Golubchik <serg@mariadb.org>2020-05-09 20:36:58 +0200
commitf5844e7c4bc693783f088a5fc9c399b786ddc8c1 (patch)
tree37abe4fcaf0c48ed6422fea06b8b7f33c6bac945 /sql/sql_base.cc
parent5b0df7433d36cc0fa220f3593382908198ad87a3 (diff)
parent607467bd63db2c6ca64610eb9f4e703711f4dfc6 (diff)
downloadmariadb-git-f5844e7c4bc693783f088a5fc9c399b786ddc8c1.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 284534eee9b..529dd815b51 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4870,10 +4870,19 @@ bool Lock_tables_prelocking_strategy::
handle_table(THD *thd, Query_tables_list *prelocking_ctx,
TABLE_LIST *table_list, bool *need_prelocking)
{
+ TABLE_LIST **last= prelocking_ctx->query_tables_last;
+
if (DML_prelocking_strategy::handle_table(thd, prelocking_ctx, table_list,
need_prelocking))
return TRUE;
+ /*
+ normally we don't need to open FK-prelocked tables for RESTRICT,
+ MDL is enough. But under LOCK TABLES we have to open everything
+ */
+ for (TABLE_LIST *tl= *last; tl; tl= tl->next_global)
+ tl->open_strategy= TABLE_LIST::OPEN_NORMAL;
+
/* We rely on a caller to check that table is going to be changed. */
DBUG_ASSERT(table_list->lock_type >= TL_WRITE_ALLOW_WRITE);