forked from facebook/mysql-5.6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdd_version.h
252 lines (189 loc) · 10.5 KB
/
dd_version.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2.0,
as published by the Free Software Foundation.
This program is also distributed with certain software (including
but not limited to OpenSSL) that is licensed under separate terms,
as designated in a particular file or component or in included license
documentation. The authors of MySQL hereby grant you an additional
permission to link the program and your derivative works with the
separately licensed software that they have included with MySQL.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifndef DD__DD_VERSION_INCLUDED
#define DD__DD_VERSION_INCLUDED
#include "mysql_version.h" // MYSQL_VERSION_ID
/**
@file sql/dd/dd_version.h
Data dictionary version.
*/
/**
The version of the current data dictionary table definitions.
This version number is stored on disk in the data dictionary. Every time
the data dictionary schema structure changes, this version number must
change. The table that stores the data dictionary version number is never
allowed to change.
The data dictionary version number is the MySQL server version number
of the first MySQL server version that published a given database schema.
The format is Mmmdd with M=Major, m=minor, d=dot, so that MySQL 8.0.4 is
encoded as 80004. This is the same version numbering scheme as the
information schema and performance schema are using.
When a data dictionary version is made public, the next change to a
dictionary table will be associated with the next available MySQL server
version number. So if DD version 80004 is made available in MySQL 8.0.4,
and 8.0.5 is an MRU with no changes to the DD tables, then the DD version
will stay 80004 also in MySQL 8.0.5. If MySQL 9.0.4 is the first GA of
9.0, and if there are no changes to the DD tables compared to 8.0.4, then
the DD version number will stay 80004 also in MySQL 9.0.4. Then, if there
are changes to the DD tables after MySQL 9.0.4, then the new DD version will
be 90005. In day to day builds internally, changes to the DD tables may be
done incrementally, so there may be different builds having the same DD
version number, yet with different DD table definitions.
Historical version number published in the data dictionary:
1: Published in 8.0.3-RC.
----------------------------------------------------------------------------
Introduced in MySQL 8.0.0 by WL#6378. Never published in a GA version.
Last changes were:
- WL#6049: Removed foreign_keys.unique_constraint_id and the corresponding
FK constraint, added foreign_keys.unique_constraint_name.
- Bug#2620373: Added index_stats.cached_time and table_stats.cached_time.
80004: Published in 8.0.4-RC.
----------------------------------------------------------------------------
Changes from version 1:
- WL#9059: Added collation clause for spatial_reference_systems.organization
- WL#9553: Added new 'options' column to the following DD tables:
catalogs, character_sets, collations, column_statistics, events,
foreign_keys, resource_groups, routines, schemata,
st_spatial_reference_systems, triggers.
(Other relevant DD tables have this column already: columns,
indexes, parameters, tables, tablespaces).
Also added explicit indexes for foreign keys instead of relying
on these to be created implicitly for the following tables/columns:
character_sets.default_collation_id, collations.character_set_id,
columns.collation_id, columns.srs_id, events.client_collation_id,
events.connection_collation_id, events.schema_collation_id,
foreign_key_column_usage.column_id, index_column_usage.column_id,
index_partitions.index_id, index_partitions.tablespace_id,
indexes.tablespace_id, parameters.collation_id,
routines.result_collation_id, routines.client_collation_id,
routines.connection_collation_id, routines.schema_collation_id,
schemata.default.collation_id, table_partitions.tablespace_id,
tables.collation_id, tables.tablespace_id, triggers.client_collation_id,
triggers.connection_collation_id, triggers.schema_collation_id,
80011: Published in 8.0 GA.
----------------------------------------------------------------------------
Changes from version 80004:
- WL#8383 and WL#9465: Removed obsolete SQL modes from enums in 'events',
'routines' and 'triggers'.
- WL#10774 removed NO_AUTO_CREATE_USER as a valid sql mode value.
As a result events, routines and triggers table are updated.
- Bug#27499518 changed the data type for the column 'hidden' in table
'columns' from BOOL to ENUM('Visible', 'SE', 'SQL').
- Bug#11754608 "MYSQL DOESN'T SHOW WHAT COLLATION WAS USED IF THAT
COLLATION IS THE DEFAU"
Added a new column 'is_explicit_collation' to the 'columns' DD table.
- BUG#27309116: Add a new column `external_language` to `mysql`.`routines`
and update `information_schema`.`routines` to reflect this column.
- Bug#27690593: CHANGE TYPE OF MYSQL.DD_PROPERTIES.PROPERTIES.
Changed type of 'dd_properties.properties' from MEDIUMTEXT to
MEDIUMBLOB.
80012: Published in 8.0.12
----------------------------------------------------------------------------
Changes from version 80011:
- Bug#27745526: Various adjustments to make the DD table definitions
in sync with WL#6379.
80013: Published in 8.0.13
----------------------------------------------------------------------------
Changes from version 80012:
- Bug#24741307: add last_checked_for_upgrade column to msyql.tables table
80014: Published in 8.0.14
----------------------------------------------------------------------------
Changes from version 80013:
- Bug#28492272: Synchronize sql_mode in server with that in DD.
80015: Not published. DD version still at 80014 in server 8.0.15.
----------------------------------------------------------------------------
No changes from version 80014.
80016: Published in 8.0.16
----------------------------------------------------------------------------
Changes from version 80014:
- WL#929 - CHECK CONSTRAINTS
New DD table check_constraints is introduced for the check
constraints metadata.
- WL#12261 adds new mysql.schemata.default_encryption DD column.
- Bug#29053560 Increases DD column mysql.tablespaces.name length to 268.
80017: Published in 8.0.17
----------------------------------------------------------------------------
Changes from version 80016:
- WL#12731 adds new mysql.schemata.se_private_data DD column.
- WL#12571 Support fully qualified hostnames longer than 60 characters
Server metadata table columns size is increased to 255.
80021: Published in 8.0.21
----------------------------------------------------------------------------
Changes from version 80017:
- WL#13341 adds new columns
mysql.tables.engine_attribute
mysql.tables.secondary_engine_attribute
mysql.columns.engine_attribute
mysql.columns.secondary_engine_attribute
mysql.indexes.engine_attribute
mysql.indexes.secondary_engine_attribute
mysql.tablespaces.engine_attribute
80022: Published in 8.0.22
----------------------------------------------------------------------------
Changes from version 80021:
- Bug#31587625: PERFORMANCE DEGRADATION AFTER WL14073: Adds definer index for
mysql.{events, routines, tables, triggers}.
80023: Current.
----------------------------------------------------------------------------
Changes from version 80022:
- WL#10905 adds new hidden type 'USER' to mysql.columns.hidden column.
- Bug#31867653 changes the type of mysql.table_partition_values.list_num from
TINYINT to SMALLINT.
80024: Next DD version number after the previous is public.
----------------------------------------------------------------------------
Changes from version 80023:
- No changes, this version number is not active yet.
*/
namespace dd {
static const uint DD_VERSION = 80023;
static_assert(DD_VERSION <= MYSQL_VERSION_ID,
"This release can not use a version number from the future");
/**
If a new DD version is published in a MRU, that version may or may not
be possible to downgrade to previous MRUs within the same GA. From a
technical perspective, we may support downgrade for some types of
changes to the DD tables, such as:
i) Addition of new attributes to a predefined general purpose option-like
field.
ii) Addition of a column at the end of the table definition.
iii) Addition of elements at the end of an enumeration column type.
iv) Extension of a VARCHAR field.
v) Addition of an index on a column.
This means we can support downgrade in terms of being able to open the DD
tables and read from them. However, additional considerations are relevant
in order to determine whether downgrade should be supported or not, e.g.:
- For changes like i) and iii): In the older version, will invalid entries
just be ignored, or will they lead to a failure?
- For changes like iv): In the older version, are there buffer sizes that
may be insufficient?
If downgrade is supported, the constant DD_VERSION_MINOR_DOWNGRADE_THRESHOLD
should be set to the lowest DD_VERSION that we may downgrade to. If downgrade
is not supported at all, then DD_VERSION_MINOR_DOWNGRADE_THRESHOLD should be
set to DD_VERSION.
It has been decided that the default policy for MySQL 8.0 is not to allow
downgrade for any minor release. One of the major reasons for this is that
this would lead to a huge amount of possible upgrade/downgrade paths with
correspondingly complicated and effort demanding QA. Thus, we set this
constant to be equal to DD_VERSION to prohibit downgrade attempts. This
decision may be relaxed for future releases.
*/
static const uint DD_VERSION_MINOR_DOWNGRADE_THRESHOLD = DD_VERSION;
static_assert(DD_VERSION_MINOR_DOWNGRADE_THRESHOLD <= MYSQL_VERSION_ID,
"This release can not use a version number from the future");
} // namespace dd
#endif /* DD__DD_VERSION_INCLUDED */