summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2018-11-03 14:24:15 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2018-11-03 14:24:15 +0400
commit6472c5c015a174ffd680fddc8f20c7a94684a552 (patch)
tree171357b96cf3025ee09092547ee34f060a62381e /sql/sql_view.cc
parent1a89356382cc1b19d878e6a29163eecc8605f414 (diff)
downloadmariadb-git-6472c5c015a174ffd680fddc8f20c7a94684a552.tar.gz
MDEV-15890 Strange error message if you try to FLUSH TABLES <view> after LOCK TABLES <view>.
LOCK view WRITE shouldn't block FLUSH view. So we set the view's mdl_request type to it's tables.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index b7ff4513a32..9a9309a133b 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1534,8 +1534,7 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
for (tbl= view_main_select_tables; tbl; tbl= tbl->next_local)
{
tbl->lock_type= table->lock_type;
- tbl->mdl_request.set_type((tbl->lock_type >= TL_WRITE_ALLOW_WRITE) ?
- MDL_SHARED_WRITE : MDL_SHARED_READ);
+ tbl->mdl_request.set_type(table->mdl_request.type);
}
/*
If the view is mergeable, we might want to