MySQL  8.0.17
Source Code Documentation
metadata.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef SQL_DD_METADATA_H
24 #define SQL_DD_METADATA_H
25 
26 #include <mysql/plugin.h> // st_plugin_int
27 
28 #include "sql/dd/string_type.h" // dd::String_type
29 
30 class THD;
31 struct st_plugin_int;
32 
33 namespace dd {
34 namespace info_schema {
35 
36 /**
37  The version of the current information_schema system views.
38 
39  This version number is stored on disk in the data dictionary.
40  Every time the information_schema structure changes,
41  this version number must change.
42 
43  The numbering to use is the MySQL version number
44  of the first MySQL version that published a given database schema.
45  The format is Mmmdd with M=Major, m=minor, d=dot,
46  so that MySQL 8.0.4 is encoded as 80004.
47 
48  Historical I_S version number published:
49 
50  1: Published in 8.0.3-RC.
51  ------------------------
52  Introduced in MySQL 8.0.0 by WL#6599. Never published in a GA version.
53 
54  80011: Published in 8.0 GA.
55  ------------------------------------
56  Changes from version 1:
57 
58  - Bug#27309116: Add a new column `external_language` to `mysql`.`routines`
59  and update `information_schema`.`routines` to reflect this column.
60 
61  - Bug#27593348: INFORMATION_SCHEMA.STATISTICS FIELD TYPE CHANGE.
62  Changes the column I_S.STATISTICS.NON_UNIQUE type from VARCHAR
63  to INT.
64 
65  Current 80012: Published in 8.0.12
66  ------------------------------------
67  Changes from version 80011:
68 
69  - Bug#27945704 UNABLE TO JOIN TABLE_CONSTRAINTS AND REFERENTIAL_CONSTRAINTS
70  Changes the collation of I_S columns that project index name and
71  constraint name to use utf8_tolower_ci.
72 
73  - WL#11864 Implement I_S.VIEW_TABLE_USAGE and I_S.VIEW_ROUTINE_USAGE
74 
75  - WL#1075 adds one column to INFORMATION_SCHEMA.STATISTICS: "EXPRESSION".
76  This column prints out the expression for functional key parts, or SQL NULL
77  if it is a regular key part. For functional key parts, COLUMN_NAME is set to
78  SQL NULL.
79 
80  80013: Published in 8.0.13
81  ------------------------------------
82  Changes from version 80012
83 
84  - WL#11000 ST_Distance with units
85  Adds a new view `information_schema`.`st_units_of_measure` with columns
86  `UNIT_NAME`, `CONVERSION_FACTOR`, `DESCRIPTION`, and `UNIT_TYPE`. This view
87  contains the supported spatial units.
88 
89  80014: Published in 8.0.14
90  ------------------------------------
91  There are no changes from version 80013. Hence server version 80014 used
92  I_S version 80013.
93 
94  80015: Not published.
95  ----------------------------------------------------------------------------
96  There are no changes from version 80014. Hence server version 80015 used
97  I_S version 80013.
98 
99  80016: Published in 8.0.14
100  ------------------------------------
101  Changes from version 80015.
102 
103  - WL#929 - CHECK CONSTRAINTS
104  New INFORMATION_SCHMEA table CHECK_CONSTRAINTS is introduced and
105  INFORMATION_SCHMEA.TABLE_CONSTRAINTS is modified to include check
106  constraints defined on the table.
107 
108  - WL#12261 Control (enforce and disable) table encryption
109  - Add new column information_schema.schemata.default_encryption
110  - information_schema.tables.options UDF definition is changed to pass
111  schema default encryption.
112 
113  80017: Current
114  ----------------------------------------------------------------------------
115  Changes from version 80016:
116 
117  - WL#12984 INFORMATION_SCHEMA and metadata related to secondary engine.
118  Changes system view definitions of
119  INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS and
120  INFORMATION_SCHEMA.COLUMNS.EXTRA.
121 
122  - Bug#29406053: OPTIMIZER_SWITCH DERIVED_MERGE=OFF CAUSES TABLE COMMENTS
123  "... IS NOT BASE TABLE"
124  Modifies the INFORMATION_SCHEMA.TABLES dynamic column definitions to
125  return NULL, if it finds a view.
126 
127  80018: Next IS version number after the previous is public.
128  ----------------------------------------------------------------------------
129  Changes from version 80016:
130  - No changes, this version number is not active yet.
131 
132 */
133 
134 static const uint IS_DD_VERSION = 80017;
135 
136 /**
137  Initialize INFORMATION_SCHEMA system views.
138 
139  @param thd Thread context.
140 
141  @return Upon failure, return true, otherwise false.
142 */
143 bool initialize(THD *thd);
144 
145 /**
146  Create INFORMATION_SCHEMA system views.
147 
148  @param thd Thread context.
149 
150  @return Upon failure, return true, otherwise false.
151 */
152 bool create_system_views(THD *thd);
153 
154 /**
155  Store the server I_S table metadata into dictionary, once during MySQL
156  server bootstrap.
157 
158  @param thd Thread context.
159 
160  @return Upon failure, return true, otherwise false.
161 */
162 bool store_server_I_S_metadata(THD *thd);
163 
164 /**
165  Store I_S table metadata into dictionary, during MySQL server startup.
166 
167  @param thd Thread context.
168 
169  @return Upon failure, return true, otherwise false.
170 */
171 bool update_I_S_metadata(THD *thd);
172 
173 /**
174  Store dynamic I_S plugin table metadata into dictionary, during INSTALL
175  command execution.
176 
177  @param thd Thread context.
178  @param plugin_int I_S Plugin of which the metadata is to be stored.
179 
180  @return Upon failure, return true, otherwise false.
181 */
182 bool store_dynamic_plugin_I_S_metadata(THD *thd, st_plugin_int *plugin_int);
183 
184 /**
185  Remove I_S view metadata from dictionary. This is used
186  UNINSTALL and server restart procedure when I_S version is changed.
187 
188  @param thd Thread context.
189  @param view_name I_S view name of which the metadata is to be stored.
190 
191  @return Upon failure, return true, otherwise false.
192 */
193 bool remove_I_S_view_metadata(THD *thd, const dd::String_type &view_name);
194 
195 } // namespace info_schema
196 } // namespace dd
197 
198 #endif // SQL_DD_METADATA_H
Definition: sql_plugin_ref.h:44
bool store_server_I_S_metadata(THD *thd)
Store the server I_S table metadata into dictionary, once during MySQL server bootstrap.
Definition: metadata.cc:593
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
bool create_system_views(THD *thd)
Create INFORMATION_SCHEMA system views.
Definition: metadata.cc:546
bool initialize(THD *thd)
Initialize INFORMATION_SCHEMA system views.
Definition: metadata.cc:667
bool remove_I_S_view_metadata(THD *thd, const dd::String_type &view_name)
Remove I_S view metadata from dictionary.
Definition: metadata.cc:636
bool update_I_S_metadata(THD *thd)
Store I_S table metadata into dictionary, during MySQL server startup.
Definition: metadata.cc:617
unsigned int uint
Definition: uca-dump.cc:29
static const uint IS_DD_VERSION
The version of the current information_schema system views.
Definition: metadata.h:134
bool store_dynamic_plugin_I_S_metadata(THD *thd, st_plugin_int *plugin_int)
Store dynamic I_S plugin table metadata into dictionary, during INSTALL command execution.
Definition: metadata.cc:625
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:39
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:777