MySQL 26.7.0
Source Code Documentation
dd_version.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2026, 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, MYSQL_VERSION_MATURITY_IS_LTS
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 the MYSQL_VERSION_ID numeric encoding:
45 MAJOR * 10000 + MINOR * 100 + PATCH. Thus, MySQL 8.0.4 is encoded as
46 80004, and MySQL 26.7.0 is encoded as 260700. This is the same version
47 numbering scheme as the information schema and performance schema are using.
48
49 When a data dictionary version is made public, the next change to a
50 dictionary table will be associated with the next available MySQL server
51 version number. So if DD version 80004 is made available in MySQL 8.0.4,
52 and 8.0.5 is an MRU with no changes to the DD tables, then the DD version
53 will stay 80004 also in MySQL 8.0.5. If MySQL 9.0.4 is the first GA of
54 9.0, and if there are no changes to the DD tables compared to 8.0.4, then
55 the DD version number will stay 80004 also in MySQL 9.0.4. Then, if there
56 are changes to the DD tables after MySQL 9.0.4, then the new DD version will
57 be 90005. In day to day builds internally, changes to the DD tables may be
58 done incrementally, so there may be different builds having the same DD
59 version number, yet with different DD table definitions.
60
61 Historical version number published in the data dictionary:
62
63
64 1: Published in 8.0.3-RC.
65 ----------------------------------------------------------------------------
66 Introduced in MySQL 8.0.0 by WL#6378. Never published in a GA version.
67 Last changes were:
68
69 - WL#6049: Removed foreign_keys.unique_constraint_id and the corresponding
70 FK constraint, added foreign_keys.unique_constraint_name.
71
72 - Bug#2620373: Added index_stats.cached_time and table_stats.cached_time.
73
74
75 80004: Published in 8.0.4-RC.
76 ----------------------------------------------------------------------------
77 Changes from version 1:
78
79 - WL#9059: Added collation clause for spatial_reference_systems.organization
80
81 - WL#9553: Added new 'options' column to the following DD tables:
82 catalogs, character_sets, collations, column_statistics, events,
83 foreign_keys, resource_groups, routines, schemata,
84 st_spatial_reference_systems, triggers.
85
86 (Other relevant DD tables have this column already: columns,
87 indexes, parameters, tables, tablespaces).
88
89 Also added explicit indexes for foreign keys instead of relying
90 on these to be created implicitly for the following tables/columns:
91 character_sets.default_collation_id, collations.character_set_id,
92 columns.collation_id, columns.srs_id, events.client_collation_id,
93 events.connection_collation_id, events.schema_collation_id,
94 foreign_key_column_usage.column_id, index_column_usage.column_id,
95 index_partitions.index_id, index_partitions.tablespace_id,
96 indexes.tablespace_id, parameters.collation_id,
97 routines.result_collation_id, routines.client_collation_id,
98 routines.connection_collation_id, routines.schema_collation_id,
99 schemata.default.collation_id, table_partitions.tablespace_id,
100 tables.collation_id, tables.tablespace_id, triggers.client_collation_id,
101 triggers.connection_collation_id, triggers.schema_collation_id,
102
103
104 80011: Published in 8.0 GA.
105 ----------------------------------------------------------------------------
106 Changes from version 80004:
107
108 - WL#8383 and WL#9465: Removed obsolete SQL modes from enums in 'events',
109 'routines' and 'triggers'.
110
111 - WL#10774 removed NO_AUTO_CREATE_USER as a valid sql mode value.
112 As a result events, routines and triggers table are updated.
113
114 - Bug#27499518 changed the data type for the column 'hidden' in table
115 'columns' from BOOL to ENUM('Visible', 'SE', 'SQL').
116
117 - Bug#11754608 "MYSQL DOESN'T SHOW WHAT COLLATION WAS USED IF THAT
118 COLLATION IS THE DEFAU"
119 Added a new column 'is_explicit_collation' to the 'columns' DD table.
120
121 - BUG#27309116: Add a new column `external_language` to `mysql`.`routines`
122 and update `information_schema`.`routines` to reflect this column.
123
124 - Bug#27690593: CHANGE TYPE OF MYSQL.DD_PROPERTIES.PROPERTIES.
125 Changed type of 'dd_properties.properties' from MEDIUMTEXT to
126 MEDIUMBLOB.
127
128
129 80012: Published in 8.0.12
130 ----------------------------------------------------------------------------
131 Changes from version 80011:
132
133 - Bug#27745526: Various adjustments to make the DD table definitions
134 in sync with WL#6379.
135
136
137 80013: Published in 8.0.13
138 ----------------------------------------------------------------------------
139 Changes from version 80012:
140
141 - Bug#24741307: add last_checked_for_upgrade column to msyql.tables table
142
143
144 80014: Published in 8.0.14
145 ----------------------------------------------------------------------------
146 Changes from version 80013:
147
148 - Bug#28492272: Synchronize sql_mode in server with that in DD.
149
150
151 80015: Not published. DD version still at 80014 in server 8.0.15.
152 ----------------------------------------------------------------------------
153 No changes from version 80014.
154
155
156 80016: Published in 8.0.16
157 ----------------------------------------------------------------------------
158 Changes from version 80014:
159
160 - WL#929 - CHECK CONSTRAINTS
161 New DD table check_constraints is introduced for the check
162 constraints metadata.
163
164 - WL#12261 adds new mysql.schemata.default_encryption DD column.
165
166 - Bug#29053560 Increases DD column mysql.tablespaces.name length to 268.
167
168 80017: Published in 8.0.17
169 ----------------------------------------------------------------------------
170 Changes from version 80016:
171
172 - WL#12731 adds new mysql.schemata.se_private_data DD column.
173 - WL#12571 Support fully qualified hostnames longer than 60 characters
174 Server metadata table columns size is increased to 255.
175
176 80021: Published in 8.0.21
177 ----------------------------------------------------------------------------
178 Changes from version 80017:
179
180 - WL#13341 adds new columns
181 mysql.tables.engine_attribute
182 mysql.tables.secondary_engine_attribute
183 mysql.columns.engine_attribute
184 mysql.columns.secondary_engine_attribute
185 mysql.indexes.engine_attribute
186 mysql.indexes.secondary_engine_attribute
187 mysql.tablespaces.engine_attribute
188
189 80022: Published in 8.0.22
190 ----------------------------------------------------------------------------
191 Changes from version 80021:
192
193 - Bug#31587625: PERFORMANCE DEGRADATION AFTER WL14073: Adds definer index for
194 mysql.{events, routines, tables, triggers}.
195
196 80023: Current.
197 ----------------------------------------------------------------------------
198 Changes from version 80022:
199
200 - WL#10905 adds new hidden type 'USER' to mysql.columns.hidden column.
201 - Bug#31867653 changes the type of mysql.table_partition_values.list_num from
202 TINYINT to SMALLINT.
203
204 80024: Next DD version number after the previous is public.
205 ----------------------------------------------------------------------------
206 Changes from version 80023:
207 - No changes, this version number is not active yet.
208
209 80200:
210 ----------------------------------------------------------------------------
211 Changes:
212 - WL#14190: Replace old terms in replication SQL commands on the SOURCE
213 > Changes the enum of mysql.events.status to use the correct terminology
214
215 80300:
216 ----------------------------------------------------------------------------
217 Changes:
218 - WL#15786: Automatically updated histograms
219 > Adds a boolean "auto-update" property to the histogram JSON object in
220 the mysql.column_statistics table.
221
222 90000:
223 ----------------------------------------------------------------------------
224 Changes:
225 - WL#16081: Native Vector Embeddings Support In MySQL And HeatWave
226
227 90200:
228 ----------------------------------------------------------------------------
229 Changes:
230 - WL#16358: Support for 3rd party JavaScript libraries
231 > Adds a new entry 'LIBRARY' to the TYPE enum in the mysql.routines
232 table, and a new DD type 'Library'.
233 */
234namespace dd {
235
236static const uint DD_VERSION = 90200;
237static_assert(DD_VERSION <= MYSQL_VERSION_ID,
238 "This release can not use a version number from the future");
239
240/**
241 If a new DD version is published, that version may or may not be possible
242 to downgrade to previous releases within the same compatibility lineage. From
243 a technical perspective, we may support downgrade for some types of
244 changes to the DD tables, such as:
245
246 i) Addition of new attributes to a predefined general purpose option-like
247 field.
248 ii) Addition of a column at the end of the table definition.
249 iii) Addition of elements at the end of an enumeration column type.
250 iv) Extension of a VARCHAR field.
251 v) Addition of an index on a column.
252
253 This means we can support downgrade in terms of being able to open the DD
254 tables and read from them. However, additional considerations are relevant
255 in order to determine whether downgrade should be supported or not, e.g.:
256
257 - For changes like i) and iii): In the older version, will invalid entries
258 just be ignored, or will they lead to a failure?
259 - For changes like iv): In the older version, are there buffer sizes that
260 may be insufficient?
261
262 If downgrade is supported, the constant DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
263 should be set to the lowest DD_VERSION in the same compatibility lineage that
264 we may downgrade to. If downgrade is not supported at all, then
265 DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be set to DD_VERSION.
266
267 It has been decided that the default policy is to not allow
268 downgrade for any minor release. One of the major reasons for this is that
269 this would lead to a huge amount of possible upgrade/downgrade paths with
270 correspondingly complicated and effort demanding QA. Thus, we set this
271 constant to be equal to DD_VERSION to prohibit downgrade attempts. This
272 decision may be relaxed for future releases.
273*/
276 "This release can not use a version number from the future");
277
278/**
279 A release model supporting Long-Term Support (LTS) and Innovation releases is
280 being used. LTS releases will be kept as stable as possible, and patch updates
281 will be provided mostly for critical issues. Innovation releases will be
282 released regularly with new features.
283
284 MySQL 9.7.x is the final LTS release line using the legacy sequential
285 major release convention. There is no MySQL 10.x release line. After
286 9.7.x, MySQL uses calendar-based versioning where releases are identified
287 as YY.M.P, e.g. 26.7.0.
288
289 For calendar versions, the MYSQL_VERSION_MINOR component identifies the
290 release month, using values from 1 through 12. Innovation releases may have
291 patch releases within the same release month, e.g. 26.7.1. LTS and
292 INNOVATION are release maturity values declared by MYSQL_VERSION_MATURITY.
293 Release maturity is not inferred from the calendar version number.
294
295 MYSQL_PREVIOUS_LTS_VERSION is declarative release metadata. It stores the LTS
296 release base that anchors the current compatibility lineage, with patch
297 forced to 0. The first calendar releases use 9.7.0. If a calendar release is
298 designated LTS, it remains in the lineage identified by its own previous-LTS
299 value. The first Innovation release after that LTS starts a new compatibility
300 lineage by using the LTS release base as MYSQL_PREVIOUS_LTS_VERSION.
301
302 Runtime upgrade checks derive the effective compatibility lineage from
303 MYSQL_PREVIOUS_LTS_VERSION. A missing MYSQL_PREVIOUS_LTS_VERSION value is
304 treated as legacy version metadata during transition validation.
305
306 With the release model supporting LTS releases, we will have to support
307 downgrade between LTS patch releases. Normally, there will be no changes in
308 features in a patch release, and the disk image should have a similar format,
309 both in terms of record layout, data dictionary structure, system table
310 definitions, information schema, performance schema, etc. However, there might
311 be situations where changes that are not backwards compatible need to be made
312 within a patch release. For some server artifacts, we already have mechanisms
313 in place to allow older versions to reject a downgrade attempt (e.g. if the
314 data dictionary is changed, the older version will reject the downgrade
315 attempt). For other artifacts, there is no such mechanism. Thus, we introduce
316 the SERVER_DOWNGRADE_THRESHOLD which makes it possible to define how far back
317 the current version should be able to downgrade. On a downgrade attempt,
318 the target version will look at the threshold which has been stored
319 persistently by the actual server that we downgrade from. If the target server
320 version is lower than the threshold, it will reject the downgrade attempt.
321
322 For LTS releases, the threshold defaults to 0. This means that downgrade back
323 to the first patch for the same release base is possible. E.g. if LTS version
324 9.7.2 has the threshold defined to 0, downgrades to 9.7.1 and 9.7.0 are
325 possible. Similarly, if a calendar LTS patch release has the threshold defined
326 to 0, downgrades to earlier patch releases in the same visible YY.M release
327 base are possible. If a later patch release in that base raises the threshold,
328 then
329 only downgrades to that threshold or later patch releases in the same base are
330 possible.
331 Downgrades to or from Innovation releases are never supported, regardless of
332 the downgrade threshold.
333*/
334
335/* Patch downgrade is rejected by default for Innovation releases. */
336#if MYSQL_VERSION_MATURITY_IS_LTS == 1
337constexpr uint SERVER_DOWNGRADE_THRESHOLD = 0;
338#else
340#endif
342 "This release can not use a version number from the future");
343
344/**
345 The release model explained above also opens the possibility of
346 upgrading to a version that has been released in the past. I.e., we will
347 upgrade from an actual version to a target version with a higher version
348 number, but an earlier (older) GA release date.
349
350 Like for the patch downgrades mentioned above, we already have mechanisms in
351 place to allow older versions to reject an upgrade attempt (e.g. if the data
352 dictionary is changed, the older version will reject the upgrade attempt).
353 For other artifacts, there is no such mechanism. Thus, we introduce the
354 SERVER_UPGRADE_THRESHOLD which makes it possible to define how far back
355 the current version should be able to upgrade. On an upgrade attempt, the
356 target version will look at the threshold which has been stored persistently
357 by the actual server that we upgrade from. If the target server version is
358 lower than the threshold, it will reject the upgrade attempt.
359
360 The threshold defaults to 0. This means that upgrades to any higher version
361 are possible unless prohibited by other rules, such as release maturity and
362 compatibility lineage rules. E.g. if LTS version 9.7.2 has the threshold
363 defined to 0, upgrades to calendar versions such as 26.7.0 and 26.10.0 are
364 possible when the normal upgrade rules allow them. Then, if LTS version 9.7.3
365 is released with the upgrade threshold set to 26.10.0, then upgrade from
366 9.7.3 is possible only to 26.10.0 or higher, again subject to the normal
367 upgrade rules.
368*/
369constexpr uint SERVER_UPGRADE_THRESHOLD = 0;
370
371} // namespace dd
372
373#endif /* DD__DD_VERSION_INCLUDED */
#define MYSQL_VERSION_ID
Definition: mysql_version.h:14
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:44
static const uint DD_VERSION
Definition: dd_version.h:236
static const uint DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
If a new DD version is published, that version may or may not be possible to downgrade to previous re...
Definition: dd_version.h:274
constexpr uint SERVER_UPGRADE_THRESHOLD
The release model explained above also opens the possibility of upgrading to a version that has been ...
Definition: dd_version.h:369
constexpr uint SERVER_DOWNGRADE_THRESHOLD
A release model supporting Long-Term Support (LTS) and Innovation releases is being used.
Definition: dd_version.h:339