summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-05 20:32:15 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-05 20:32:15 +0200
commit8049d2e9d98388296c86854d1291aa69afc78f44 (patch)
tree148b3823dab34d668b7c546e783239caa896873b /sql/sql_view.cc
parentfb5ee7d6d043b01fabc59f09d70d532e843add60 (diff)
parentf0c19b6a57b699d113e3ae4a67920924bbecae45 (diff)
downloadmariadb-git-8049d2e9d98388296c86854d1291aa69afc78f44.tar.gz
Merge 10.0 into 10.1
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 5604ffd5bee..90c94e6a503 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -429,6 +429,15 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
lex->link_first_table_back(view, link_to_local);
view->open_type= OT_BASE_ONLY;
+ /*
+ ignore lock specs for CREATE statement
+ */
+ if (lex->current_select->lock_type != TL_READ_DEFAULT)
+ {
+ lex->current_select->set_lock_for_tables(TL_READ_DEFAULT);
+ view->mdl_request.set_type(MDL_EXCLUSIVE);
+ }
+
if (open_temporary_tables(thd, lex->query_tables) ||
open_and_lock_tables(thd, lex->query_tables, TRUE, 0))
{