MySQL 8.4.2
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
208 80200:
209 ----------------------------------------------------------------------------
210 Changes:
211 - WL#14190: Replace old terms in replication SQL commands on the SOURCE
212 > Changes the enum of mysql.events.status to use the correct terminology
213
214 80300:
215 ----------------------------------------------------------------------------
216 Changes:
217 - WL#15786: Automatically updated histograms
218 > Adds a boolean "auto-update" property to the histogram JSON object in
219 the mysql.column_statistics table.
220 */
221namespace dd {
222
223static const uint DD_VERSION = 80300;
224static_assert(DD_VERSION <= MYSQL_VERSION_ID,
225 "This release can not use a version number from the future");
226
227/**
228 If a new DD version is published in a MRU, that version may or may not
229 be possible to downgrade to previous MRUs within the same GA. From a
230 technical perspective, we may support downgrade for some types of
231 changes to the DD tables, such as:
232
233 i) Addition of new attributes to a predefined general purpose option-like
234 field.
235 ii) Addition of a column at the end of the table definition.
236 iii) Addition of elements at the end of an enumeration column type.
237 iv) Extension of a VARCHAR field.
238 v) Addition of an index on a column.
239
240 This means we can support downgrade in terms of being able to open the DD
241 tables and read from them. However, additional considerations are relevant
242 in order to determine whether downgrade should be supported or not, e.g.:
243
244 - For changes like i) and iii): In the older version, will invalid entries
245 just be ignored, or will they lead to a failure?
246 - For changes like iv): In the older version, are there buffer sizes that
247 may be insufficient?
248
249 If downgrade is supported, the constant DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
250 should be set to the lowest DD_VERSION that we may downgrade to. If downgrade
251 is not supported at all, then DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be
252 set to DD_VERSION.
253
254 It has been decided that the default policy for MySQL 8.0 is not to allow
255 downgrade for any minor release. One of the major reasons for this is that
256 this would lead to a huge amount of possible upgrade/downgrade paths with
257 correspondingly complicated and effort demanding QA. Thus, we set this
258 constant to be equal to DD_VERSION to prohibit downgrade attempts. This
259 decision may be relaxed for future releases.
260*/
263 "This release can not use a version number from the future");
264
265/**
266 A new release model supporting Long Term Stability (LTS) and innovation
267 releases is being introduced. The LTS releases will be kept as stable as
268 possible, patch updates will be provided mostly for critical issues.
269 Innovation releases will be released regularly with new features.
270
271 When we start a new major version, e.g. 9.0.0, this is an innovation release.
272 Each consecutive release is a new innovation release where the minor version
273 number is incremented. The last minor version for a given major version is an
274 LTS release, this will normally have minor version 7, e.g. 9.7.0. The LTS
275 release will have regular CPU releases (critical patch update) where the major
276 and minor versions stay unchanged, and only the patch number is incremented
277 (e.g. 9.7.1, 9.7.2 etc.). In parallel with the CPU releases, a new major
278 version will also be released, starting with an incremented major version
279 number (e.g. 10.0.0). In some cases, the innovation releases may also have
280 CPU releases, e.g. 9.1.0, 9.1.1 etc.
281
282 With the release model supporting LTS releases, we will have to support
283 downgrade between patch releases. Normally, there will be no changes in
284 features in a patch release, and the disk image should have a similar format,
285 both in terms of record layout, data dictionary structure, system table
286 definitions, information schema, performance schema, etc. However, there might
287 be situations where changes that are not backwards compatible need to be made
288 within a patch release. For some server artifacts, we already have mechanisms
289 in place to allow older versions to reject a downgrade attempt (e.g. if the
290 data dictionary is changed, the older version will reject the downgrade
291 attempt). For other artifacts, there is no such mechanism. Thus, we introduce
292 the SERVER_DOWNGRADE_THRESHOLD which makes it possible to define how far back
293 the current version should be able to downgrade. On a downgrade attempt,
294 the target version will look at the threshold which has been stored
295 persistently by the actual server that we downgrade from. If the target server
296 version is lower than the threshold, it will reject the downgrade attempt.
297
298 The threshold defaults to 0. This means that downgrade back to the first patch
299 for the given version is possible. E.g. if LTS version 9.7.2 has the threshold
300 defined to 0, downgrades to 9.7.1 and 9.7.0 is possible. Then, if LTS version
301 9.7.3 is released with the threshold set to 9.7.2, then only downgrade to
302 9.7.2 is possible. Downgrades to or from innovation releases are never
303 supported, regardless of the downgrade threshold.
304*/
305constexpr uint SERVER_DOWNGRADE_THRESHOLD = 0;
307 "This release can not use a version number from the future");
308
309/**
310 The new release model explained above will also open the possibility of
311 upgrading to a version that has been released in the past. I.e., we will
312 upgrade from an actual version to a target version with a higher version
313 number, but an earlier (older) GA release date.
314
315 Like for the patch downgrades mentioned above, we already have mechanisms in
316 place to allow older versions to reject an upgrade attempt (e.g. if the data
317 dictionary is changed, the older version will reject the upgrade attempt).
318 For other artifacts, there is no such mechanism. Thus, we introduce the
319 SERVER_UPGRADE_THRESHOLD which makes it possible to define how far back
320 the current version should be able to upgrade. On an upgrade attempt, the
321 target version will look at the threshold which has been stored persistently
322 by the actual server that we upgrade from. If the target server version is
323 lower than the threshold, it will reject the upgrade attempt.
324
325 The threshold defaults to 0. This means that for upgrades to any higher
326 version is possible (unless prohibited by other rules). E.g. if LTS version
327 9.7.2 has the threshold defined to 0, upgrades to 10.0.0, 10.1.0 etc. is
328 possible. Then, if LTS version 9.7.3 is released with the upgrade threshold
329 set to 10.2.0, then upograde from 9.7.3 is possible only to 10.2.0 or higher.
330*/
331constexpr uint SERVER_UPGRADE_THRESHOLD = 0;
332
333} // namespace dd
334
335#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:223
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:261
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:331
constexpr uint SERVER_DOWNGRADE_THRESHOLD
A new release model supporting Long Term Stability (LTS) and innovation releases is being introduced.
Definition: dd_version.h:305