MySQL 8.0.37
Source Code Documentation
dd_version.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef DD__DD_VERSION_INCLUDED
25#define DD__DD_VERSION_INCLUDED
26
27#include "mysql_version.h" // MYSQL_VERSION_ID
28
29/**
30 @file sql/dd/dd_version.h
31 Data dictionary version.
32*/
33
34/**
35 The version of the current data dictionary table definitions.
36
37 This version number is stored on disk in the data dictionary. Every time
38 the data dictionary schema structure changes, this version number must
39 change. The table that stores the data dictionary version number is never
40 allowed to change.
41
42 The data dictionary version number is the MySQL server version number
43 of the first MySQL server version that published a given database schema.
44 The format is Mmmdd with M=Major, m=minor, d=dot, so that MySQL 8.0.4 is
45 encoded as 80004. This is the same version numbering scheme as the
46 information schema and performance schema are using.
47
48 When a data dictionary version is made public, the next change to a
49 dictionary table will be associated with the next available MySQL server
50 version number. So if DD version 80004 is made available in MySQL 8.0.4,
51 and 8.0.5 is an MRU with no changes to the DD tables, then the DD version
52 will stay 80004 also in MySQL 8.0.5. If MySQL 9.0.4 is the first GA of
53 9.0, and if there are no changes to the DD tables compared to 8.0.4, then
54 the DD version number will stay 80004 also in MySQL 9.0.4. Then, if there
55 are changes to the DD tables after MySQL 9.0.4, then the new DD version will
56 be 90005. In day to day builds internally, changes to the DD tables may be
57 done incrementally, so there may be different builds having the same DD
58 version number, yet with different DD table definitions.
59
60 Historical version number published in the data dictionary:
61
62
63 1: Published in 8.0.3-RC.
64 ----------------------------------------------------------------------------
65 Introduced in MySQL 8.0.0 by WL#6378. Never published in a GA version.
66 Last changes were:
67
68 - WL#6049: Removed foreign_keys.unique_constraint_id and the corresponding
69 FK constraint, added foreign_keys.unique_constraint_name.
70
71 - Bug#2620373: Added index_stats.cached_time and table_stats.cached_time.
72
73
74 80004: Published in 8.0.4-RC.
75 ----------------------------------------------------------------------------
76 Changes from version 1:
77
78 - WL#9059: Added collation clause for spatial_reference_systems.organization
79
80 - WL#9553: Added new 'options' column to the following DD tables:
81 catalogs, character_sets, collations, column_statistics, events,
82 foreign_keys, resource_groups, routines, schemata,
83 st_spatial_reference_systems, triggers.
84
85 (Other relevant DD tables have this column already: columns,
86 indexes, parameters, tables, tablespaces).
87
88 Also added explicit indexes for foreign keys instead of relying
89 on these to be created implicitly for the following tables/columns:
90 character_sets.default_collation_id, collations.character_set_id,
91 columns.collation_id, columns.srs_id, events.client_collation_id,
92 events.connection_collation_id, events.schema_collation_id,
93 foreign_key_column_usage.column_id, index_column_usage.column_id,
94 index_partitions.index_id, index_partitions.tablespace_id,
95 indexes.tablespace_id, parameters.collation_id,
96 routines.result_collation_id, routines.client_collation_id,
97 routines.connection_collation_id, routines.schema_collation_id,
98 schemata.default.collation_id, table_partitions.tablespace_id,
99 tables.collation_id, tables.tablespace_id, triggers.client_collation_id,
100 triggers.connection_collation_id, triggers.schema_collation_id,
101
102
103 80011: Published in 8.0 GA.
104 ----------------------------------------------------------------------------
105 Changes from version 80004:
106
107 - WL#8383 and WL#9465: Removed obsolete SQL modes from enums in 'events',
108 'routines' and 'triggers'.
109
110 - WL#10774 removed NO_AUTO_CREATE_USER as a valid sql mode value.
111 As a result events, routines and triggers table are updated.
112
113 - Bug#27499518 changed the data type for the column 'hidden' in table
114 'columns' from BOOL to ENUM('Visible', 'SE', 'SQL').
115
116 - Bug#11754608 "MYSQL DOESN'T SHOW WHAT COLLATION WAS USED IF THAT
117 COLLATION IS THE DEFAU"
118 Added a new column 'is_explicit_collation' to the 'columns' DD table.
119
120 - BUG#27309116: Add a new column `external_language` to `mysql`.`routines`
121 and update `information_schema`.`routines` to reflect this column.
122
123 - Bug#27690593: CHANGE TYPE OF MYSQL.DD_PROPERTIES.PROPERTIES.
124 Changed type of 'dd_properties.properties' from MEDIUMTEXT to
125 MEDIUMBLOB.
126
127
128 80012: Published in 8.0.12
129 ----------------------------------------------------------------------------
130 Changes from version 80011:
131
132 - Bug#27745526: Various adjustments to make the DD table definitions
133 in sync with WL#6379.
134
135
136 80013: Published in 8.0.13
137 ----------------------------------------------------------------------------
138 Changes from version 80012:
139
140 - Bug#24741307: add last_checked_for_upgrade column to msyql.tables table
141
142
143 80014: Published in 8.0.14
144 ----------------------------------------------------------------------------
145 Changes from version 80013:
146
147 - Bug#28492272: Synchronize sql_mode in server with that in DD.
148
149
150 80015: Not published. DD version still at 80014 in server 8.0.15.
151 ----------------------------------------------------------------------------
152 No changes from version 80014.
153
154
155 80016: Published in 8.0.16
156 ----------------------------------------------------------------------------
157 Changes from version 80014:
158
159 - WL#929 - CHECK CONSTRAINTS
160 New DD table check_constraints is introduced for the check
161 constraints metadata.
162
163 - WL#12261 adds new mysql.schemata.default_encryption DD column.
164
165 - Bug#29053560 Increases DD column mysql.tablespaces.name length to 268.
166
167 80017: Published in 8.0.17
168 ----------------------------------------------------------------------------
169 Changes from version 80016:
170
171 - WL#12731 adds new mysql.schemata.se_private_data DD column.
172 - WL#12571 Support fully qualified hostnames longer than 60 characters
173 Server metadata table columns size is increased to 255.
174
175 80021: Published in 8.0.21
176 ----------------------------------------------------------------------------
177 Changes from version 80017:
178
179 - WL#13341 adds new columns
180 mysql.tables.engine_attribute
181 mysql.tables.secondary_engine_attribute
182 mysql.columns.engine_attribute
183 mysql.columns.secondary_engine_attribute
184 mysql.indexes.engine_attribute
185 mysql.indexes.secondary_engine_attribute
186 mysql.tablespaces.engine_attribute
187
188 80022: Published in 8.0.22
189 ----------------------------------------------------------------------------
190 Changes from version 80021:
191
192 - Bug#31587625: PERFORMANCE DEGRADATION AFTER WL14073: Adds definer index for
193 mysql.{events, routines, tables, triggers}.
194
195 80023: Current.
196 ----------------------------------------------------------------------------
197 Changes from version 80022:
198
199 - WL#10905 adds new hidden type 'USER' to mysql.columns.hidden column.
200 - Bug#31867653 changes the type of mysql.table_partition_values.list_num from
201 TINYINT to SMALLINT.
202
203 80024: Next DD version number after the previous is public.
204 ----------------------------------------------------------------------------
205 Changes from version 80023:
206 - No changes, this version number is not active yet.
207 */
208namespace dd {
209
210static const uint DD_VERSION = 80023;
211static_assert(DD_VERSION <= MYSQL_VERSION_ID,
212 "This release can not use a version number from the future");
213
214/**
215 If a new DD version is published in a MRU, that version may or may not
216 be possible to downgrade to previous MRUs within the same GA. From a
217 technical perspective, we may support downgrade for some types of
218 changes to the DD tables, such as:
219
220 i) Addition of new attributes to a predefined general purpose option-like
221 field.
222 ii) Addition of a column at the end of the table definition.
223 iii) Addition of elements at the end of an enumeration column type.
224 iv) Extension of a VARCHAR field.
225 v) Addition of an index on a column.
226
227 This means we can support downgrade in terms of being able to open the DD
228 tables and read from them. However, additional considerations are relevant
229 in order to determine whether downgrade should be supported or not, e.g.:
230
231 - For changes like i) and iii): In the older version, will invalid entries
232 just be ignored, or will they lead to a failure?
233 - For changes like iv): In the older version, are there buffer sizes that
234 may be insufficient?
235
236 If downgrade is supported, the constant DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
237 should be set to the lowest DD_VERSION that we may downgrade to. If downgrade
238 is not supported at all, then DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be
239 set to DD_VERSION.
240
241 It has been decided that the default policy for MySQL 8.0 is not to allow
242 downgrade for any minor release. One of the major reasons for this is that
243 this would lead to a huge amount of possible upgrade/downgrade paths with
244 correspondingly complicated and effort demanding QA. Thus, we set this
245 constant to be equal to DD_VERSION to prohibit downgrade attempts. This
246 decision may be relaxed for future releases.
247*/
250 "This release can not use a version number from the future");
251
252/**
253 A new release model supporting Long Term Stability (LTS) and innovation
254 releases is being introduced. The LTS releases will be kept as stable as
255 possible, patch updates will be provided mostly for critical issues.
256 Innovation releases will be released regularly with new features.
257
258 When we start a new major version, e.g. 9.0.0, this is an innovation release.
259 Each consecutive release is a new innovation release where the minor version
260 number is incremented. The last minor version for a given major version is an
261 LTS release, this will normally have minor version 7, e.g. 9.7.0. The LTS
262 release will have regular CPU releases (critical patch update) where the major
263 and minor versions stay unchanged, and only the patch number is incremented
264 (e.g. 9.7.1, 9.7.2 etc.). In parallel with the CPU releases, a new major
265 version will also be released, starting with an incremented major version
266 number (e.g. 10.0.0). In some cases, the innovation releases may also have
267 CPU releases, e.g. 9.1.0, 9.1.1 etc.
268
269 With the release model supporting LTS releases, we will have to support
270 downgrade between patch releases. Normally, there will be no changes in
271 features in a patch release, and the disk image should have a similar format,
272 both in terms of record layout, data dictionary structure, system table
273 definitions, information schema, performance schema, etc. However, there might
274 be situations where changes that are not backwards compatible need to be made
275 within a patch release. For some server artifacts, we already have mechanisms
276 in place to allow older versions to reject a downgrade attempt (e.g. if the
277 data dictionary is changed, the older version will reject the downgrade
278 attempt). For other artifacts, there is no such mechanism. Thus, we introduce
279 the SERVER_DOWNGRADE_THRESHOLD which makes it possible to define how far back
280 the current version should be able to downgrade. On a downgrade attempt,
281 the target version will look at the threshold which has been stored
282 persistently by the actual server that we downgrade from. If the target server
283 version is lower than the threshold, it will reject the downgrade attempt.
284
285 The threshold defaults to 0. This means that downgrade back to the first patch
286 for the given version is possible. E.g. if LTS version 9.7.2 has the threshold
287 defined to 0, downgrades to 9.7.1 and 9.7.0 is possible. Then, if LTS version
288 9.7.3 is released with the threshold set to 9.7.2, then only downgrade to
289 9.7.2 is possible. Downgrades to or from innovation releases are never
290 supported, regardless of the downgrade threshold.
291*/
294 "This release can not use a version number from the future");
295
296/**
297 The new release model explained above will also open the possibility of
298 upgrading to a version that has been released in the past. I.e., we will
299 upgrade from an actual version to a target version with a higher version
300 number, but an earlier (older) GA release date.
301
302 Like for the patch downgrades mentioned above, we already have mechanisms in
303 place to allow older versions to reject an upgrade attempt (e.g. if the data
304 dictionary is changed, the older version will reject the upgrade attempt).
305 For other artifacts, there is no such mechanism. Thus, we introduce the
306 SERVER_UPGRADE_THRESHOLD which makes it possible to define how far back
307 the current version should be able to upgrade. On an upgrade attempt, the
308 target version will look at the threshold which has been stored persistently
309 by the actual server that we upgrade from. If the target server version is
310 lower than the threshold, it will reject the upgrade attempt.
311
312 The threshold defaults to 0. This means that for upgrades to any higher
313 version is possible (unless prohibited by other rules). E.g. if LTS version
314 9.7.2 has the threshold defined to 0, upgrades to 10.0.0, 10.1.0 etc. is
315 possible. Then, if LTS version 9.7.3 is released with the upgrade threshold
316 set to 10.2.0, then upograde from 9.7.3 is possible only to 10.2.0 or higher.
317*/
319
320} // namespace dd
321
322#endif /* DD__DD_VERSION_INCLUDED */
#define MYSQL_VERSION_ID
Definition: mysql_version.h:15
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
static const uint DD_VERSION
Definition: dd_version.h:210
static const uint DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
If a new DD version is published in a MRU, that version may or may not be possible to downgrade to pr...
Definition: dd_version.h:248
constexpr uint SERVER_UPGRADE_THRESHOLD
The new release model explained above will also open the possibility of upgrading to a version that h...
Definition: dd_version.h:318
constexpr uint SERVER_DOWNGRADE_THRESHOLD
A new release model supporting Long Term Stability (LTS) and innovation releases is being introduced.
Definition: dd_version.h:292
unsigned int uint
Definition: uca9-dump.cc:75