summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-05-26 11:22:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-05-26 11:22:40 +0300
commit860e754349646fb8ec8e9231a7fc09a5d4b7c247 (patch)
treed66c4b8a3c96e8e0d6e6ad9dfb12cdca750eb754 /sql/sql_view.cc
parent71e1ddda220c2d452351fc6bf240cb0bad6ccf4a (diff)
parent365cd08345ab759308cfcac663a2a5880c0c33cb (diff)
downloadmariadb-git-860e754349646fb8ec8e9231a7fc09a5d4b7c247.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 3fc55552f6b..eb5c1bff200 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2004, 2013, Oracle and/or its affiliates.
- Copyright (c) 2011, 2016, MariaDB Corporation
+ Copyright (c) 2011, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,7 +34,6 @@
#include "sp_cache.h"
#include "datadict.h" // dd_frm_is_view()
#include "sql_derived.h"
-#include "sql_cte.h" // check_dependencies_in_with_clauses()
#include "opt_trace.h"
#include "ddl_log.h"
#include "debug.h" // debug_crash_here
@@ -440,12 +439,6 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
lex->link_first_table_back(view, link_to_local);
view->open_type= OT_BASE_ONLY;
- if (check_dependencies_in_with_clauses(lex->with_clauses_list))
- {
- res= TRUE;
- goto err_no_relink;
- }
-
WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL);
/*
@@ -944,6 +937,13 @@ static int mysql_register_view(THD *thd, DDL_LOG_STATE *ddl_log_state,
LEX *lex= thd->lex;
/*
+ Ensure character set number != 17 (character set = filename) and mbminlen=1
+ because these character sets are not parser friendly, which can give weird
+ sequence in .frm file of view and later give parsing error.
+ */
+ DBUG_ASSERT(thd->charset()->mbminlen == 1 && thd->charset()->number != 17);
+
+ /*
View definition query -- a SELECT statement that fully defines view. It
is generated from the Item-tree built from the original (specified by
the user) query. The idea is that generated query should eliminates all
@@ -1485,9 +1485,6 @@ bool mysql_make_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *table,
TABLE_LIST *tbl;
Security_context *security_ctx= 0;
- if (check_dependencies_in_with_clauses(thd->lex->with_clauses_list))
- goto err;
-
/*
Check rights to run commands which show underlying tables.
In the optimizer trace we would not like to show trace for