MySQL  8.0.19
Source Code Documentation
sql_view.h
Go to the documentation of this file.
1 #ifndef SQL_VIEW_INCLUDED
2 #define SQL_VIEW_INCLUDED
3 
4 /* Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License, version 2.0,
8  as published by the Free Software Foundation.
9 
10  This program is also distributed with certain software (including
11  but not limited to OpenSSL) that is licensed under separate terms,
12  as designated in a particular file or component or in included license
13  documentation. The authors of MySQL hereby grant you an additional
14  permission to link the program and your derivative works with the
15  separately licensed software that they have included with MySQL.
16 
17  This program is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License, version 2.0, for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with this program; if not, write to the Free Software
24  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
25 
26 #include "lex_string.h"
27 #include "sql/auth/auth_acls.h"
28 #include "sql/mem_root_array.h"
29 
30 class Item;
31 class THD;
32 struct TABLE_LIST;
33 struct TABLE_SHARE;
34 template <class T>
35 class List;
36 
37 enum class enum_view_create_mode;
38 
39 bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
41 
43 
44 bool mysql_register_view(THD *thd, TABLE_LIST *view,
46 
47 bool mysql_drop_view(THD *thd, TABLE_LIST *view);
48 
49 bool check_key_in_view(THD *thd, TABLE_LIST *view, const TABLE_LIST *table_ref);
50 
52 
55  List<Item> &item_list, bool gen_unique_view_names);
56 
57 bool open_and_read_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *view_ref);
58 
59 bool parse_view_definition(THD *thd, TABLE_LIST *view_ref);
60 
61 /*
62  Check if view is updatable.
63 
64  @param thd Thread Handle.
65  @param view View description.
66 
67  @retval true View is updatable.
68  @retval false Otherwise.
69 */
70 bool is_updatable_view(THD *thd, TABLE_LIST *view);
71 
72 #define VIEW_ANY_ACL (SELECT_ACL | UPDATE_ACL | INSERT_ACL | DELETE_ACL)
73 
74 #endif /* SQL_VIEW_INCLUDED */
check_duplicate_names
bool check_duplicate_names(const Create_col_name_list *column_names, List< Item > &item_list, bool gen_unique_view_names)
When creating a derived table, check if duplicate column names are present, and possibly generate uni...
Definition: sql_view.cc:158
Item
Definition: item.h:665
THD
Definition: sql_class.h:764
create_view_precheck
bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, enum_view_create_mode mode)
CREATE VIEW privileges pre-check.
Definition: sql_view.cc:315
mysql_drop_view
bool mysql_drop_view(THD *thd, TABLE_LIST *view)
Drop view.
Definition: sql_view.cc:1639
auth_acls.h
check_key_in_view
bool check_key_in_view(THD *thd, TABLE_LIST *view, const TABLE_LIST *table_ref)
check of key (primary or unique) presence in updatable view
Definition: sql_view.cc:1804
TABLE_SHARE
This structure is shared between different table objects.
Definition: table.h:653
open_and_read_view
bool open_and_read_view(THD *thd, TABLE_SHARE *share, TABLE_LIST *view_ref)
Open and read a view definition.
Definition: sql_view.cc:1066
lex_string.h
mysql_create_view
bool mysql_create_view(THD *thd, TABLE_LIST *view, enum_view_create_mode mode)
Creating/altering VIEW procedure.
Definition: sql_view.cc:426
is_updatable_view
bool is_updatable_view(THD *thd, TABLE_LIST *view)
Definition: sql_view.cc:764
Mem_root_array_YY< LEX_CSTRING >
list
class udf_list * list
mysql_register_view
bool mysql_register_view(THD *thd, TABLE_LIST *view, enum_view_create_mode mode)
Register view by writing its definition to the data-dictionary.
Definition: sql_view.cc:845
TABLE_LIST
Definition: table.h:2467
insert_view_fields
bool insert_view_fields(List< Item > *list, TABLE_LIST *view)
Definition: sql_view.cc:1912
column_names
static bool column_names
Definition: mysql.cc:158
Create_col_name_list
Mem_root_array_YY< LEX_CSTRING > Create_col_name_list
Definition: sql_view.h:53
parse_view_definition
bool parse_view_definition(THD *thd, TABLE_LIST *view_ref)
Parse a view definition.
Definition: sql_view.cc:1183
enum_view_create_mode
enum_view_create_mode
Definition: sql_lex.h:232
List
Definition: aggregate_check.h:523
mem_root_array.h