summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2016-06-02 12:12:26 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2016-09-04 14:15:21 +0200
commit1da21cd4a58ba61274475b5a54592ea1b82a2f13 (patch)
tree6ffa44053ac325fad1f36c5f309aa1b4b48e51b8 /sql/sql_view.cc
parent3dcca1b7247fff8f0658c38ebdecc5de4cfc8ca0 (diff)
downloadmariadb-git-1da21cd4a58ba61274475b5a54592ea1b82a2f13.tar.gz
MDEV-10035: DBUG_ASSERT on CREATE VIEW v1 AS SELECT * FROM t1 FOR UPDATE
Ability to print lock type added. Restoring correct lock type for CREATE VIEW added.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 4744b442842..c0d9ba48121 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -435,7 +435,16 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
res= TRUE;
goto err;
}
-
+
+ /*
+ 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 (thd->open_temporary_tables(lex->query_tables) ||
open_and_lock_tables(thd, lex->query_tables, TRUE, 0))
{