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