1########################################################################
2#
3# Verify definitions of DD tables.
4# --------------------------------
5# This test has four parts:
6#
7# 1. Verify the hard coded ids of the mysql schema, the mysql
8#    tablespace, the dd_properties table, and the
9#    innodb_dynamic_metadata table.
10# 2. Verify the existence of the expected DD tables, neither less nor
11#    more.
12# 3. Verify the DD_VERSION and the CREATE TABLE statements of the
13#    DD tables.
14# 4. Verify the checksum of the generated meta data associated with the
15#    current DD version number.
16#
17########################################################################
18#
19# A note regarding the checksum usage.
20# ------------------------------------
21# This is based on a test by Marc Alff (perfschema.dd_version_check).
22# The idea is to keep a record of each DD version released with the
23# DD version number and a checksum created based on the meta data for
24# the DD tables. It is important not to change the expected checksum
25# once a release has been published.
26#
27# If there was an intentional change, leading to a new checksum, then:
28#
29# 1. Uncomment the debug output showing the low level meta data and
30#    verify that the changes are intentional.
31# 2. Create a new target DD version (unless the existing target DD
32#    version is not publicly released yet).
33# 3. Add a new row in test.dd_published_schema with the new target
34#    DD version and the new checksum (or update the expected
35#    checksum if the target DD version is not publicly released yet).
36#
37# Note that a failure to do 2, when doing 3, will result in a broken
38# upgrade where the server code is expecting a certain DD table
39# definition, while the actual persisted DD table definition is
40# different (because it was created by a previous server binary, and
41# DD upgrade handling was not triggered).
42#
43# Thus, this part of the test is designed to be a reminder to do 2.
44# by detecting differences in 3.
45#
46########################################################################
47#
48# How to handle test failures.
49# ----------------------------
50# In general, if there is a change leading to a failure in this test,
51# then we must first consider whether the change is intentional, i.e.,
52# whether there is a change in a DD table definition or DD bootstrap
53# code that we actually want to do, or whether the change is by mistake
54# or not needed.
55#
56# Then, if the change is intentional, we must make sure the following
57# scenarios are handled:
58#
59# 1. Plain initialization of the server. This is most likely handled,
60#    otherwise we wouldn't even get to the point where this test starts
61#    failing.
62# 2. Plain server restart using a data directory initialized by this
63#    server.
64# 3. Upgrade from any supported DD version, or server restart using
65#    a data directory from a different server version using the same
66#    DD version.
67# 4. Minor downgrade to any DD version within the minor downgrade
68#    threshold, or restart of a different server version using the
69#    data directory initialized by this server.
70#
71# Failures in the different parts of the test must be handled as
72# follows:
73#
74# *  A failure in part 1 means that the server may not be able to start,
75#    e.g. if we restart a previous server version (expecting different
76#    ids) using a data directory initialized by this server version.
77# *  A failure in part 2 means that a DD table is added or removed.
78#    In this case, please make sure the tables 'dd_table_names' and
79#    'ddse_table_names' below are kept up to date. Also make sure that
80#    the list of SHOW CREATE TABLE statements is up to date.
81# *  A failure in part 2 or 3 means that there is a change in the DD
82#    table definitions, and that we have a new DD version. So
83#    if the current target DD version number is released publicly,
84#    then we must bump the target DD version. If the DD version is
85#    not yet released, and has already been bumped, then it should
86#    stay the same. Additionally, we must add server code to handle
87#    the DD upgrade. This test must have its results re-recorded. A
88#    failure in part 2 or 3 will most likely also lead to a failure
89#    in part 4.
90# *  A failure in part 4 means that the generated meta data is
91#    different than it used to be. If there is a change in part 2 or
92#    3, this is to be expected. In that case, the test results must
93#    be re-recorded, and we must either update the expected checksum
94#    (if the DD version stays the same) or add the new DD version
95#    along with the expected checksum. However, if there is not a
96#    change in part 2 or 3, then we have changes in the SQL DDL
97#    semantics. This should be handled by changing the DD initialization
98#    procedure to either tweak the DDL statements before execution
99#    (without changing the DDL statements that are stored in the
100#    mysql.dd_properties table), or by tweaking the generated low
101#    level meta data. Either way, the result of the changes to the
102#    server code should be that this test stops failing.
103#
104########################################################################
105# PART 1
106########################################################################
107# Verify the hard coded ids of the mysql schema, the mysql tablespace,
108# the dd_properties table, and the innodb_dynamic_metadata table.
109########################################################################
110SET debug = '+d,skip_dd_table_access_check';
111########################################################################
112# The id of the mysql schema must be fixed.
113########################################################################
114include/assert.inc [The id of the 'mysql' schema is 1.]
115########################################################################
116# The ids of the mysql tablespace must be fixed.
117########################################################################
118include/assert.inc [The id of the 'mysql' tablespace is 1.]
119include/assert.inc [The SE private id of the 'mysql' tablespace is 4294967294.]
120########################################################################
121# The ids of the dd_properties table must be fixed.
122########################################################################
123include/assert.inc [The id of 'mysql.dd_properties' is 1.]
124include/assert.inc [The SE private id of 'mysql.dd_properties' is 1.]
125include/assert.inc [The clustering index id of 'mysql.dd_properties' is 1.]
126########################################################################
127# The ids of the innodb_dynamic_metadata table must be fixed.
128########################################################################
129include/assert.inc [The id of 'mysql.innodb_dynamic_metadata' is 2.]
130include/assert.inc [The SE private id of 'mysql.innodb_dynamic_metadata' is 2.]
131include/assert.inc [The index id of 'mysql.innodb_dynamic_metadata' is 2.]
132SET debug = '-d,skip_dd_table_access_check';
133# PART 2
134CREATE TABLE test.ddse_table_names (name VARCHAR(64) PRIMARY KEY);
135CREATE TABLE test.dd_table_names (name VARCHAR(64) PRIMARY KEY);
136########################################################################
137# Verify the existence of the expected DD tables, neither less nor more.
138# Fill two help tables with the DD and DDSE table names.
139########################################################################
140SET debug = '+d,skip_dd_table_access_check';
141########################################################################
142# The number of hidden DD/DDSE tables must be as expected.
143########################################################################
144include/assert.inc [There are 32 hidden DD/DDSE tables.]
145include/assert.inc [There are 34 DD/DDSE tables in total.]
146########################################################################
147# No unexpected DD tables must be present.
148########################################################################
149include/assert.inc [No unexpected DD tables are present.]
150########################################################################
151# All expected DD tables must be present.
152########################################################################
153include/assert.inc [All expected DD tables are present.]
154########################################################################
155# All expected DDSE tables must be present.
156########################################################################
157include/assert.inc [All expected DDSE are be present.]
158SET debug = '-d,skip_dd_table_access_check';
159# PART 3
160########################################################################
161# Verify the DD_VERSION and the CREATE TABLE statements of the
162# DD tables.
163########################################################################
164SET debug = '+d,skip_dd_table_access_check';
165########################################################################
166# The actual DD version stored on disk.
167########################################################################
168DD_VERSION=80021
169########################################################################
170# List the CREATE TABLE statements for the DD tables.
171# Mask the AUTO INCREMENT counter, which is not
172# deterministic when running mtr. Mask collations that
173# depend on the lower case table names setting.
174########################################################################
175catalogs	CREATE TABLE `catalogs` (
176  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
177  `name` varchar(64) <LCTN dependent collation> NOT NULL,
178  `created` timestamp NOT NULL,
179  `last_altered` timestamp NOT NULL,
180  `options` mediumtext COLLATE utf8_bin,
181  PRIMARY KEY (`id`),
182  UNIQUE KEY `name` (`name`)
183) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
184character_sets	CREATE TABLE `character_sets` (
185  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
186  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
187  `default_collation_id` bigint unsigned NOT NULL,
188  `comment` varchar(2048) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
189  `mb_max_length` int unsigned NOT NULL,
190  `options` mediumtext COLLATE utf8_bin,
191  PRIMARY KEY (`id`),
192  UNIQUE KEY `name` (`name`),
193  UNIQUE KEY `default_collation_id` (`default_collation_id`),
194  CONSTRAINT `character_sets_ibfk_1` FOREIGN KEY (`default_collation_id`) REFERENCES `collations` (`id`)
195) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
196collations	CREATE TABLE `collations` (
197  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
198  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
199  `character_set_id` bigint unsigned NOT NULL,
200  `is_compiled` tinyint(1) NOT NULL,
201  `sort_length` int unsigned NOT NULL,
202  `pad_attribute` enum('PAD SPACE','NO PAD') COLLATE utf8_bin NOT NULL,
203  `options` mediumtext COLLATE utf8_bin,
204  PRIMARY KEY (`id`),
205  UNIQUE KEY `name` (`name`),
206  KEY `character_set_id` (`character_set_id`),
207  CONSTRAINT `collations_ibfk_1` FOREIGN KEY (`character_set_id`) REFERENCES `character_sets` (`id`)
208) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
209column_statistics	CREATE TABLE `column_statistics` (
210  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
211  `catalog_id` bigint unsigned NOT NULL,
212  `name` varchar(255) COLLATE utf8_bin NOT NULL,
213  `schema_name` varchar(64) <LCTN dependent collation> NOT NULL,
214  `table_name` varchar(64) <LCTN dependent collation> NOT NULL,
215  `column_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci NOT NULL,
216  `histogram` json NOT NULL,
217  `options` mediumtext COLLATE utf8_bin,
218  PRIMARY KEY (`id`),
219  UNIQUE KEY `catalog_id` (`catalog_id`,`name`),
220  UNIQUE KEY `catalog_id_2` (`catalog_id`,`schema_name`,`table_name`,`column_name`),
221  CONSTRAINT `column_statistics_ibfk_1` FOREIGN KEY (`catalog_id`) REFERENCES `catalogs` (`id`)
222) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
223column_type_elements	CREATE TABLE `column_type_elements` (
224  `column_id` bigint unsigned NOT NULL,
225  `element_index` int unsigned NOT NULL,
226  `name` varbinary(1020) NOT NULL,
227  PRIMARY KEY (`column_id`,`element_index`),
228  CONSTRAINT `column_type_elements_ibfk_1` FOREIGN KEY (`column_id`) REFERENCES `columns` (`id`)
229) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
230columns	CREATE TABLE `columns` (
231  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
232  `table_id` bigint unsigned NOT NULL,
233  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci NOT NULL,
234  `ordinal_position` int unsigned NOT NULL,
235  `type` enum('MYSQL_TYPE_DECIMAL','MYSQL_TYPE_TINY','MYSQL_TYPE_SHORT','MYSQL_TYPE_LONG','MYSQL_TYPE_FLOAT','MYSQL_TYPE_DOUBLE','MYSQL_TYPE_NULL','MYSQL_TYPE_TIMESTAMP','MYSQL_TYPE_LONGLONG','MYSQL_TYPE_INT24','MYSQL_TYPE_DATE','MYSQL_TYPE_TIME','MYSQL_TYPE_DATETIME','MYSQL_TYPE_YEAR','MYSQL_TYPE_NEWDATE','MYSQL_TYPE_VARCHAR','MYSQL_TYPE_BIT','MYSQL_TYPE_TIMESTAMP2','MYSQL_TYPE_DATETIME2','MYSQL_TYPE_TIME2','MYSQL_TYPE_NEWDECIMAL','MYSQL_TYPE_ENUM','MYSQL_TYPE_SET','MYSQL_TYPE_TINY_BLOB','MYSQL_TYPE_MEDIUM_BLOB','MYSQL_TYPE_LONG_BLOB','MYSQL_TYPE_BLOB','MYSQL_TYPE_VAR_STRING','MYSQL_TYPE_STRING','MYSQL_TYPE_GEOMETRY','MYSQL_TYPE_JSON') COLLATE utf8_bin NOT NULL,
236  `is_nullable` tinyint(1) NOT NULL,
237  `is_zerofill` tinyint(1) DEFAULT NULL,
238  `is_unsigned` tinyint(1) DEFAULT NULL,
239  `char_length` int unsigned DEFAULT NULL,
240  `numeric_precision` int unsigned DEFAULT NULL,
241  `numeric_scale` int unsigned DEFAULT NULL,
242  `datetime_precision` int unsigned DEFAULT NULL,
243  `collation_id` bigint unsigned DEFAULT NULL,
244  `has_no_default` tinyint(1) DEFAULT NULL,
245  `default_value` blob,
246  `default_value_utf8` text COLLATE utf8_bin,
247  `default_option` blob,
248  `update_option` varchar(32) COLLATE utf8_bin DEFAULT NULL,
249  `is_auto_increment` tinyint(1) DEFAULT NULL,
250  `is_virtual` tinyint(1) DEFAULT NULL,
251  `generation_expression` longblob,
252  `generation_expression_utf8` longtext COLLATE utf8_bin,
253  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
254  `hidden` enum('Visible','SE','SQL') COLLATE utf8_bin NOT NULL,
255  `options` mediumtext COLLATE utf8_bin,
256  `se_private_data` mediumtext COLLATE utf8_bin,
257  `column_key` enum('','PRI','UNI','MUL') COLLATE utf8_bin NOT NULL,
258  `column_type_utf8` mediumtext COLLATE utf8_bin NOT NULL,
259  `srs_id` int unsigned DEFAULT NULL,
260  `is_explicit_collation` tinyint(1) DEFAULT NULL,
261  `engine_attribute` json DEFAULT NULL,
262  `secondary_engine_attribute` json DEFAULT NULL,
263  PRIMARY KEY (`id`),
264  UNIQUE KEY `table_id` (`table_id`,`name`),
265  UNIQUE KEY `table_id_2` (`table_id`,`ordinal_position`),
266  KEY `collation_id` (`collation_id`),
267  KEY `srs_id` (`srs_id`),
268  CONSTRAINT `columns_ibfk_1` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`),
269  CONSTRAINT `columns_ibfk_2` FOREIGN KEY (`collation_id`) REFERENCES `collations` (`id`),
270  CONSTRAINT `columns_ibfk_3` FOREIGN KEY (`srs_id`) REFERENCES `st_spatial_reference_systems` (`id`)
271) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
272dd_properties	CREATE TABLE `dd_properties` (
273  `properties` mediumblob
274) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
275events	CREATE TABLE `events` (
276  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
277  `schema_id` bigint unsigned NOT NULL,
278  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
279  `definer` varchar(288) COLLATE utf8_bin NOT NULL,
280  `time_zone` varchar(64) COLLATE utf8_bin NOT NULL,
281  `definition` longblob NOT NULL,
282  `definition_utf8` longtext COLLATE utf8_bin NOT NULL,
283  `execute_at` datetime DEFAULT NULL,
284  `interval_value` int DEFAULT NULL,
285  `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') COLLATE utf8_bin DEFAULT NULL,
286  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL') COLLATE utf8_bin NOT NULL,
287  `starts` datetime DEFAULT NULL,
288  `ends` datetime DEFAULT NULL,
289  `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') COLLATE utf8_bin NOT NULL,
290  `on_completion` enum('DROP','PRESERVE') COLLATE utf8_bin NOT NULL,
291  `created` timestamp NOT NULL,
292  `last_altered` timestamp NOT NULL,
293  `last_executed` datetime DEFAULT NULL,
294  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
295  `originator` int unsigned NOT NULL,
296  `client_collation_id` bigint unsigned NOT NULL,
297  `connection_collation_id` bigint unsigned NOT NULL,
298  `schema_collation_id` bigint unsigned NOT NULL,
299  `options` mediumtext COLLATE utf8_bin,
300  PRIMARY KEY (`id`),
301  UNIQUE KEY `schema_id` (`schema_id`,`name`),
302  KEY `client_collation_id` (`client_collation_id`),
303  KEY `connection_collation_id` (`connection_collation_id`),
304  KEY `schema_collation_id` (`schema_collation_id`),
305  CONSTRAINT `events_ibfk_1` FOREIGN KEY (`schema_id`) REFERENCES `schemata` (`id`),
306  CONSTRAINT `events_ibfk_2` FOREIGN KEY (`client_collation_id`) REFERENCES `collations` (`id`),
307  CONSTRAINT `events_ibfk_3` FOREIGN KEY (`connection_collation_id`) REFERENCES `collations` (`id`),
308  CONSTRAINT `events_ibfk_4` FOREIGN KEY (`schema_collation_id`) REFERENCES `collations` (`id`)
309) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
310foreign_key_column_usage	CREATE TABLE `foreign_key_column_usage` (
311  `foreign_key_id` bigint unsigned NOT NULL,
312  `ordinal_position` int unsigned NOT NULL,
313  `column_id` bigint unsigned NOT NULL,
314  `referenced_column_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci NOT NULL,
315  PRIMARY KEY (`foreign_key_id`,`ordinal_position`),
316  UNIQUE KEY `foreign_key_id` (`foreign_key_id`,`column_id`,`referenced_column_name`),
317  KEY `column_id` (`column_id`),
318  CONSTRAINT `foreign_key_column_usage_ibfk_1` FOREIGN KEY (`foreign_key_id`) REFERENCES `foreign_keys` (`id`),
319  CONSTRAINT `foreign_key_column_usage_ibfk_2` FOREIGN KEY (`column_id`) REFERENCES `columns` (`id`)
320) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
321foreign_keys	CREATE TABLE `foreign_keys` (
322  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
323  `schema_id` bigint unsigned NOT NULL,
324  `table_id` bigint unsigned NOT NULL,
325  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
326  `unique_constraint_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci DEFAULT NULL,
327  `match_option` enum('NONE','PARTIAL','FULL') COLLATE utf8_bin NOT NULL,
328  `update_rule` enum('NO ACTION','RESTRICT','CASCADE','SET NULL','SET DEFAULT') COLLATE utf8_bin NOT NULL,
329  `delete_rule` enum('NO ACTION','RESTRICT','CASCADE','SET NULL','SET DEFAULT') COLLATE utf8_bin NOT NULL,
330  `referenced_table_catalog` varchar(64) <LCTN dependent collation> NOT NULL,
331  `referenced_table_schema` varchar(64) <LCTN dependent collation> NOT NULL,
332  `referenced_table_name` varchar(64) <LCTN dependent collation> NOT NULL,
333  `options` mediumtext COLLATE utf8_bin,
334  PRIMARY KEY (`id`),
335  UNIQUE KEY `schema_id` (`schema_id`,`name`),
336  UNIQUE KEY `table_id` (`table_id`,`name`),
337  KEY `referenced_table_catalog` (`referenced_table_catalog`,`referenced_table_schema`,`referenced_table_name`),
338  CONSTRAINT `foreign_keys_ibfk_1` FOREIGN KEY (`schema_id`) REFERENCES `schemata` (`id`)
339) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
340index_column_usage	CREATE TABLE `index_column_usage` (
341  `index_id` bigint unsigned NOT NULL,
342  `ordinal_position` int unsigned NOT NULL,
343  `column_id` bigint unsigned NOT NULL,
344  `length` int unsigned DEFAULT NULL,
345  `order` enum('UNDEF','ASC','DESC') COLLATE utf8_bin NOT NULL,
346  `hidden` tinyint(1) NOT NULL,
347  UNIQUE KEY `index_id` (`index_id`,`ordinal_position`),
348  UNIQUE KEY `index_id_2` (`index_id`,`column_id`,`hidden`),
349  KEY `column_id` (`column_id`),
350  CONSTRAINT `index_column_usage_ibfk_1` FOREIGN KEY (`index_id`) REFERENCES `indexes` (`id`),
351  CONSTRAINT `index_column_usage_ibfk_2` FOREIGN KEY (`column_id`) REFERENCES `columns` (`id`)
352) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
353index_partitions	CREATE TABLE `index_partitions` (
354  `partition_id` bigint unsigned NOT NULL,
355  `index_id` bigint unsigned NOT NULL,
356  `options` mediumtext COLLATE utf8_bin,
357  `se_private_data` mediumtext COLLATE utf8_bin,
358  `tablespace_id` bigint unsigned DEFAULT NULL,
359  PRIMARY KEY (`partition_id`,`index_id`),
360  KEY `index_id` (`index_id`),
361  KEY `tablespace_id` (`tablespace_id`),
362  CONSTRAINT `index_partitions_ibfk_1` FOREIGN KEY (`partition_id`) REFERENCES `table_partitions` (`id`),
363  CONSTRAINT `index_partitions_ibfk_2` FOREIGN KEY (`index_id`) REFERENCES `indexes` (`id`),
364  CONSTRAINT `index_partitions_ibfk_3` FOREIGN KEY (`tablespace_id`) REFERENCES `tablespaces` (`id`)
365) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
366index_stats	CREATE TABLE `index_stats` (
367  `schema_name` varchar(64) COLLATE utf8_bin NOT NULL,
368  `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
369  `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
370  `column_name` varchar(64) COLLATE utf8_bin NOT NULL,
371  `cardinality` bigint unsigned DEFAULT NULL,
372  `cached_time` timestamp NOT NULL,
373  UNIQUE KEY `schema_name` (`schema_name`,`table_name`,`index_name`,`column_name`)
374) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
375indexes	CREATE TABLE `indexes` (
376  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
377  `table_id` bigint unsigned NOT NULL,
378  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci NOT NULL,
379  `type` enum('PRIMARY','UNIQUE','MULTIPLE','FULLTEXT','SPATIAL') COLLATE utf8_bin NOT NULL,
380  `algorithm` enum('SE_SPECIFIC','BTREE','RTREE','HASH','FULLTEXT') COLLATE utf8_bin NOT NULL,
381  `is_algorithm_explicit` tinyint(1) NOT NULL,
382  `is_visible` tinyint(1) NOT NULL,
383  `is_generated` tinyint(1) NOT NULL,
384  `hidden` tinyint(1) NOT NULL,
385  `ordinal_position` int unsigned NOT NULL,
386  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
387  `options` mediumtext COLLATE utf8_bin,
388  `se_private_data` mediumtext COLLATE utf8_bin,
389  `tablespace_id` bigint unsigned DEFAULT NULL,
390  `engine` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
391  `engine_attribute` json DEFAULT NULL,
392  `secondary_engine_attribute` json DEFAULT NULL,
393  PRIMARY KEY (`id`),
394  UNIQUE KEY `table_id` (`table_id`,`name`),
395  KEY `tablespace_id` (`tablespace_id`),
396  CONSTRAINT `indexes_ibfk_1` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`),
397  CONSTRAINT `indexes_ibfk_2` FOREIGN KEY (`tablespace_id`) REFERENCES `tablespaces` (`id`)
398) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
399innodb_ddl_log	CREATE TABLE `innodb_ddl_log` (
400  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
401  `thread_id` bigint unsigned NOT NULL,
402  `type` int unsigned NOT NULL,
403  `space_id` int unsigned DEFAULT NULL,
404  `page_no` int unsigned DEFAULT NULL,
405  `index_id` bigint unsigned DEFAULT NULL,
406  `table_id` bigint unsigned DEFAULT NULL,
407  `old_file_path` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
408  `new_file_path` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
409  PRIMARY KEY (`id`),
410  KEY `thread_id` (`thread_id`)
411) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
412innodb_dynamic_metadata	CREATE TABLE `innodb_dynamic_metadata` (
413  `table_id` bigint unsigned NOT NULL,
414  `version` bigint unsigned NOT NULL,
415  `metadata` blob NOT NULL,
416  PRIMARY KEY (`table_id`)
417) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
418innodb_index_stats	CREATE TABLE `innodb_index_stats` (
419  `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
420  `table_name` varchar(199) COLLATE utf8_bin NOT NULL,
421  `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
422  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
423  `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
424  `stat_value` bigint unsigned NOT NULL,
425  `sample_size` bigint unsigned DEFAULT NULL,
426  `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
427  PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
428) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
429innodb_table_stats	CREATE TABLE `innodb_table_stats` (
430  `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
431  `table_name` varchar(199) COLLATE utf8_bin NOT NULL,
432  `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
433  `n_rows` bigint unsigned NOT NULL,
434  `clustered_index_size` bigint unsigned NOT NULL,
435  `sum_of_other_index_sizes` bigint unsigned NOT NULL,
436  PRIMARY KEY (`database_name`,`table_name`)
437) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
438parameter_type_elements	CREATE TABLE `parameter_type_elements` (
439  `parameter_id` bigint unsigned NOT NULL,
440  `element_index` int unsigned NOT NULL,
441  `name` varbinary(1020) NOT NULL,
442  PRIMARY KEY (`parameter_id`,`element_index`),
443  CONSTRAINT `parameter_type_elements_ibfk_1` FOREIGN KEY (`parameter_id`) REFERENCES `parameters` (`id`)
444) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
445parameters	CREATE TABLE `parameters` (
446  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
447  `routine_id` bigint unsigned NOT NULL,
448  `ordinal_position` int unsigned NOT NULL,
449  `mode` enum('IN','OUT','INOUT') COLLATE utf8_bin DEFAULT NULL,
450  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
451  `data_type` enum('MYSQL_TYPE_DECIMAL','MYSQL_TYPE_TINY','MYSQL_TYPE_SHORT','MYSQL_TYPE_LONG','MYSQL_TYPE_FLOAT','MYSQL_TYPE_DOUBLE','MYSQL_TYPE_NULL','MYSQL_TYPE_TIMESTAMP','MYSQL_TYPE_LONGLONG','MYSQL_TYPE_INT24','MYSQL_TYPE_DATE','MYSQL_TYPE_TIME','MYSQL_TYPE_DATETIME','MYSQL_TYPE_YEAR','MYSQL_TYPE_NEWDATE','MYSQL_TYPE_VARCHAR','MYSQL_TYPE_BIT','MYSQL_TYPE_TIMESTAMP2','MYSQL_TYPE_DATETIME2','MYSQL_TYPE_TIME2','MYSQL_TYPE_NEWDECIMAL','MYSQL_TYPE_ENUM','MYSQL_TYPE_SET','MYSQL_TYPE_TINY_BLOB','MYSQL_TYPE_MEDIUM_BLOB','MYSQL_TYPE_LONG_BLOB','MYSQL_TYPE_BLOB','MYSQL_TYPE_VAR_STRING','MYSQL_TYPE_STRING','MYSQL_TYPE_GEOMETRY','MYSQL_TYPE_JSON') COLLATE utf8_bin NOT NULL,
452  `data_type_utf8` mediumtext COLLATE utf8_bin NOT NULL,
453  `is_zerofill` tinyint(1) DEFAULT NULL,
454  `is_unsigned` tinyint(1) DEFAULT NULL,
455  `char_length` int unsigned DEFAULT NULL,
456  `numeric_precision` int unsigned DEFAULT NULL,
457  `numeric_scale` int unsigned DEFAULT NULL,
458  `datetime_precision` int unsigned DEFAULT NULL,
459  `collation_id` bigint unsigned DEFAULT NULL,
460  `options` mediumtext COLLATE utf8_bin,
461  PRIMARY KEY (`id`),
462  UNIQUE KEY `routine_id` (`routine_id`,`ordinal_position`),
463  KEY `collation_id` (`collation_id`),
464  CONSTRAINT `parameters_ibfk_1` FOREIGN KEY (`routine_id`) REFERENCES `routines` (`id`),
465  CONSTRAINT `parameters_ibfk_2` FOREIGN KEY (`collation_id`) REFERENCES `collations` (`id`)
466) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
467resource_groups	CREATE TABLE `resource_groups` (
468  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
469  `resource_group_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
470  `resource_group_type` enum('SYSTEM','USER') COLLATE utf8_bin NOT NULL,
471  `resource_group_enabled` tinyint(1) NOT NULL,
472  `cpu_id_mask` varchar(1024) COLLATE utf8_bin NOT NULL,
473  `thread_priority` int NOT NULL,
474  `options` mediumtext COLLATE utf8_bin,
475  PRIMARY KEY (`id`),
476  UNIQUE KEY `resource_group_name` (`resource_group_name`)
477) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
478routines	CREATE TABLE `routines` (
479  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
480  `schema_id` bigint unsigned NOT NULL,
481  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
482  `type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
483  `result_data_type` enum('MYSQL_TYPE_DECIMAL','MYSQL_TYPE_TINY','MYSQL_TYPE_SHORT','MYSQL_TYPE_LONG','MYSQL_TYPE_FLOAT','MYSQL_TYPE_DOUBLE','MYSQL_TYPE_NULL','MYSQL_TYPE_TIMESTAMP','MYSQL_TYPE_LONGLONG','MYSQL_TYPE_INT24','MYSQL_TYPE_DATE','MYSQL_TYPE_TIME','MYSQL_TYPE_DATETIME','MYSQL_TYPE_YEAR','MYSQL_TYPE_NEWDATE','MYSQL_TYPE_VARCHAR','MYSQL_TYPE_BIT','MYSQL_TYPE_TIMESTAMP2','MYSQL_TYPE_DATETIME2','MYSQL_TYPE_TIME2','MYSQL_TYPE_NEWDECIMAL','MYSQL_TYPE_ENUM','MYSQL_TYPE_SET','MYSQL_TYPE_TINY_BLOB','MYSQL_TYPE_MEDIUM_BLOB','MYSQL_TYPE_LONG_BLOB','MYSQL_TYPE_BLOB','MYSQL_TYPE_VAR_STRING','MYSQL_TYPE_STRING','MYSQL_TYPE_GEOMETRY','MYSQL_TYPE_JSON') COLLATE utf8_bin DEFAULT NULL,
484  `result_data_type_utf8` mediumtext COLLATE utf8_bin NOT NULL,
485  `result_is_zerofill` tinyint(1) DEFAULT NULL,
486  `result_is_unsigned` tinyint(1) DEFAULT NULL,
487  `result_char_length` int unsigned DEFAULT NULL,
488  `result_numeric_precision` int unsigned DEFAULT NULL,
489  `result_numeric_scale` int unsigned DEFAULT NULL,
490  `result_datetime_precision` int unsigned DEFAULT NULL,
491  `result_collation_id` bigint unsigned DEFAULT NULL,
492  `definition` longblob,
493  `definition_utf8` longtext COLLATE utf8_bin,
494  `parameter_str` blob,
495  `is_deterministic` tinyint(1) NOT NULL,
496  `sql_data_access` enum('CONTAINS SQL','NO SQL','READS SQL DATA','MODIFIES SQL DATA') COLLATE utf8_bin NOT NULL,
497  `security_type` enum('DEFAULT','INVOKER','DEFINER') COLLATE utf8_bin NOT NULL,
498  `definer` varchar(288) COLLATE utf8_bin NOT NULL,
499  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL') COLLATE utf8_bin NOT NULL,
500  `client_collation_id` bigint unsigned NOT NULL,
501  `connection_collation_id` bigint unsigned NOT NULL,
502  `schema_collation_id` bigint unsigned NOT NULL,
503  `created` timestamp NOT NULL,
504  `last_altered` timestamp NOT NULL,
505  `comment` text COLLATE utf8_bin NOT NULL,
506  `options` mediumtext COLLATE utf8_bin,
507  `external_language` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT 'SQL',
508  PRIMARY KEY (`id`),
509  UNIQUE KEY `schema_id` (`schema_id`,`type`,`name`),
510  KEY `result_collation_id` (`result_collation_id`),
511  KEY `client_collation_id` (`client_collation_id`),
512  KEY `connection_collation_id` (`connection_collation_id`),
513  KEY `schema_collation_id` (`schema_collation_id`),
514  CONSTRAINT `routines_ibfk_1` FOREIGN KEY (`schema_id`) REFERENCES `schemata` (`id`),
515  CONSTRAINT `routines_ibfk_2` FOREIGN KEY (`result_collation_id`) REFERENCES `collations` (`id`),
516  CONSTRAINT `routines_ibfk_3` FOREIGN KEY (`client_collation_id`) REFERENCES `collations` (`id`),
517  CONSTRAINT `routines_ibfk_4` FOREIGN KEY (`connection_collation_id`) REFERENCES `collations` (`id`),
518  CONSTRAINT `routines_ibfk_5` FOREIGN KEY (`schema_collation_id`) REFERENCES `collations` (`id`)
519) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
520schemata	CREATE TABLE `schemata` (
521  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
522  `catalog_id` bigint unsigned NOT NULL,
523  `name` varchar(64) <LCTN dependent collation> NOT NULL,
524  `default_collation_id` bigint unsigned NOT NULL,
525  `created` timestamp NOT NULL,
526  `last_altered` timestamp NOT NULL,
527  `options` mediumtext COLLATE utf8_bin,
528  `default_encryption` enum('NO','YES') COLLATE utf8_bin NOT NULL,
529  `se_private_data` mediumtext COLLATE utf8_bin,
530  PRIMARY KEY (`id`),
531  UNIQUE KEY `catalog_id` (`catalog_id`,`name`),
532  KEY `default_collation_id` (`default_collation_id`),
533  CONSTRAINT `schemata_ibfk_1` FOREIGN KEY (`catalog_id`) REFERENCES `catalogs` (`id`),
534  CONSTRAINT `schemata_ibfk_2` FOREIGN KEY (`default_collation_id`) REFERENCES `collations` (`id`)
535) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
536st_spatial_reference_systems	CREATE TABLE `st_spatial_reference_systems` (
537  `id` int unsigned NOT NULL,
538  `catalog_id` bigint unsigned NOT NULL,
539  `name` varchar(80) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
540  `last_altered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
541  `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
542  `organization` varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
543  `organization_coordsys_id` int unsigned DEFAULT NULL,
544  `definition` varchar(4096) COLLATE utf8_bin NOT NULL,
545  `description` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
546  `options` mediumtext COLLATE utf8_bin,
547  PRIMARY KEY (`id`),
548  UNIQUE KEY `SRS_NAME` (`catalog_id`,`name`),
549  UNIQUE KEY `ORGANIZATION_AND_ID` (`catalog_id`,`organization`,`organization_coordsys_id`),
550  CONSTRAINT `st_spatial_reference_systems_ibfk_1` FOREIGN KEY (`catalog_id`) REFERENCES `catalogs` (`id`)
551) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
552table_partition_values	CREATE TABLE `table_partition_values` (
553  `partition_id` bigint unsigned NOT NULL,
554  `list_num` tinyint unsigned NOT NULL,
555  `column_num` tinyint unsigned NOT NULL,
556  `value_utf8` text COLLATE utf8_bin,
557  `max_value` tinyint(1) NOT NULL,
558  PRIMARY KEY (`partition_id`,`list_num`,`column_num`),
559  CONSTRAINT `table_partition_values_ibfk_1` FOREIGN KEY (`partition_id`) REFERENCES `table_partitions` (`id`)
560) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
561table_partitions	CREATE TABLE `table_partitions` (
562  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
563  `table_id` bigint unsigned NOT NULL,
564  `parent_partition_id` bigint unsigned DEFAULT NULL,
565  `number` smallint unsigned NOT NULL,
566  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_tolower_ci NOT NULL,
567  `description_utf8` text COLLATE utf8_bin,
568  `engine` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
569  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
570  `options` mediumtext COLLATE utf8_bin,
571  `se_private_data` mediumtext COLLATE utf8_bin,
572  `se_private_id` bigint unsigned DEFAULT NULL,
573  `tablespace_id` bigint unsigned DEFAULT NULL,
574  PRIMARY KEY (`id`),
575  UNIQUE KEY `table_id` (`table_id`,`name`),
576  UNIQUE KEY `table_id_2` (`table_id`,`parent_partition_id`,`number`),
577  UNIQUE KEY `engine` (`engine`,`se_private_id`),
578  KEY `engine_2` (`engine`),
579  KEY `tablespace_id` (`tablespace_id`),
580  KEY `parent_partition_id` (`parent_partition_id`),
581  CONSTRAINT `table_partitions_ibfk_1` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`),
582  CONSTRAINT `table_partitions_ibfk_2` FOREIGN KEY (`tablespace_id`) REFERENCES `tablespaces` (`id`),
583  CONSTRAINT `table_partitions_ibfk_3` FOREIGN KEY (`parent_partition_id`) REFERENCES `table_partitions` (`id`)
584) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
585table_stats	CREATE TABLE `table_stats` (
586  `schema_name` varchar(64) COLLATE utf8_bin NOT NULL,
587  `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
588  `table_rows` bigint unsigned DEFAULT NULL,
589  `avg_row_length` bigint unsigned DEFAULT NULL,
590  `data_length` bigint unsigned DEFAULT NULL,
591  `max_data_length` bigint unsigned DEFAULT NULL,
592  `index_length` bigint unsigned DEFAULT NULL,
593  `data_free` bigint unsigned DEFAULT NULL,
594  `auto_increment` bigint unsigned DEFAULT NULL,
595  `checksum` bigint unsigned DEFAULT NULL,
596  `update_time` timestamp NULL DEFAULT NULL,
597  `check_time` timestamp NULL DEFAULT NULL,
598  `cached_time` timestamp NOT NULL,
599  PRIMARY KEY (`schema_name`,`table_name`)
600) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
601tables	CREATE TABLE `tables` (
602  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
603  `schema_id` bigint unsigned NOT NULL,
604  `name` varchar(64) <LCTN dependent collation> NOT NULL,
605  `type` enum('BASE TABLE','VIEW','SYSTEM VIEW') COLLATE utf8_bin NOT NULL,
606  `engine` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
607  `mysql_version_id` int unsigned NOT NULL,
608  `row_format` enum('Fixed','Dynamic','Compressed','Redundant','Compact','Paged') COLLATE utf8_bin DEFAULT NULL,
609  `collation_id` bigint unsigned DEFAULT NULL,
610  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
611  `hidden` enum('Visible','System','SE','DDL') COLLATE utf8_bin NOT NULL,
612  `options` mediumtext COLLATE utf8_bin,
613  `se_private_data` mediumtext COLLATE utf8_bin,
614  `se_private_id` bigint unsigned DEFAULT NULL,
615  `tablespace_id` bigint unsigned DEFAULT NULL,
616  `partition_type` enum('HASH','KEY_51','KEY_55','LINEAR_HASH','LINEAR_KEY_51','LINEAR_KEY_55','RANGE','LIST','RANGE_COLUMNS','LIST_COLUMNS','AUTO','AUTO_LINEAR') COLLATE utf8_bin DEFAULT NULL,
617  `partition_expression` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
618  `partition_expression_utf8` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
619  `default_partitioning` enum('NO','YES','NUMBER') COLLATE utf8_bin DEFAULT NULL,
620  `subpartition_type` enum('HASH','KEY_51','KEY_55','LINEAR_HASH','LINEAR_KEY_51','LINEAR_KEY_55') COLLATE utf8_bin DEFAULT NULL,
621  `subpartition_expression` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
622  `subpartition_expression_utf8` varchar(2048) COLLATE utf8_bin DEFAULT NULL,
623  `default_subpartitioning` enum('NO','YES','NUMBER') COLLATE utf8_bin DEFAULT NULL,
624  `created` timestamp NOT NULL,
625  `last_altered` timestamp NOT NULL,
626  `view_definition` longblob,
627  `view_definition_utf8` longtext COLLATE utf8_bin,
628  `view_check_option` enum('NONE','LOCAL','CASCADED') COLLATE utf8_bin DEFAULT NULL,
629  `view_is_updatable` enum('NO','YES') COLLATE utf8_bin DEFAULT NULL,
630  `view_algorithm` enum('UNDEFINED','TEMPTABLE','MERGE') COLLATE utf8_bin DEFAULT NULL,
631  `view_security_type` enum('DEFAULT','INVOKER','DEFINER') COLLATE utf8_bin DEFAULT NULL,
632  `view_definer` varchar(288) COLLATE utf8_bin DEFAULT NULL,
633  `view_client_collation_id` bigint unsigned DEFAULT NULL,
634  `view_connection_collation_id` bigint unsigned DEFAULT NULL,
635  `view_column_names` longtext COLLATE utf8_bin,
636  `last_checked_for_upgrade_version_id` int unsigned NOT NULL,
637  `engine_attribute` json DEFAULT NULL,
638  `secondary_engine_attribute` json DEFAULT NULL,
639  PRIMARY KEY (`id`),
640  UNIQUE KEY `schema_id` (`schema_id`,`name`),
641  UNIQUE KEY `engine` (`engine`,`se_private_id`),
642  KEY `engine_2` (`engine`),
643  KEY `collation_id` (`collation_id`),
644  KEY `tablespace_id` (`tablespace_id`),
645  KEY `type` (`type`),
646  KEY `view_client_collation_id` (`view_client_collation_id`),
647  KEY `view_connection_collation_id` (`view_connection_collation_id`),
648  CONSTRAINT `tables_ibfk_1` FOREIGN KEY (`schema_id`) REFERENCES `schemata` (`id`),
649  CONSTRAINT `tables_ibfk_2` FOREIGN KEY (`collation_id`) REFERENCES `collations` (`id`),
650  CONSTRAINT `tables_ibfk_3` FOREIGN KEY (`tablespace_id`) REFERENCES `tablespaces` (`id`),
651  CONSTRAINT `tables_ibfk_4` FOREIGN KEY (`view_client_collation_id`) REFERENCES `collations` (`id`),
652  CONSTRAINT `tables_ibfk_5` FOREIGN KEY (`view_connection_collation_id`) REFERENCES `collations` (`id`)
653) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
654tablespace_files	CREATE TABLE `tablespace_files` (
655  `tablespace_id` bigint unsigned NOT NULL,
656  `ordinal_position` int unsigned NOT NULL,
657  `file_name` varchar(512) COLLATE utf8_bin NOT NULL,
658  `se_private_data` mediumtext COLLATE utf8_bin,
659  UNIQUE KEY `tablespace_id` (`tablespace_id`,`ordinal_position`),
660  UNIQUE KEY `file_name` (`file_name`),
661  CONSTRAINT `tablespace_files_ibfk_1` FOREIGN KEY (`tablespace_id`) REFERENCES `tablespaces` (`id`)
662) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
663tablespaces	CREATE TABLE `tablespaces` (
664  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
665  `name` varchar(268) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
666  `options` mediumtext COLLATE utf8_bin,
667  `se_private_data` mediumtext COLLATE utf8_bin,
668  `comment` varchar(2048) COLLATE utf8_bin NOT NULL,
669  `engine` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
670  `engine_attribute` json DEFAULT NULL,
671  PRIMARY KEY (`id`),
672  UNIQUE KEY `name` (`name`)
673) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
674triggers	CREATE TABLE `triggers` (
675  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
676  `schema_id` bigint unsigned NOT NULL,
677  `name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
678  `event_type` enum('INSERT','UPDATE','DELETE') COLLATE utf8_bin NOT NULL,
679  `table_id` bigint unsigned NOT NULL,
680  `action_timing` enum('BEFORE','AFTER') COLLATE utf8_bin NOT NULL,
681  `action_order` int unsigned NOT NULL,
682  `action_statement` longblob NOT NULL,
683  `action_statement_utf8` longtext COLLATE utf8_bin NOT NULL,
684  `created` timestamp(2) NOT NULL,
685  `last_altered` timestamp(2) NOT NULL,
686  `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','NOT_USED_9','NOT_USED_10','NOT_USED_11','NOT_USED_12','NOT_USED_13','NOT_USED_14','NOT_USED_15','NOT_USED_16','NOT_USED_17','NOT_USED_18','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','ALLOW_INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NOT_USED_29','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','TIME_TRUNCATE_FRACTIONAL') COLLATE utf8_bin NOT NULL,
687  `definer` varchar(288) COLLATE utf8_bin NOT NULL,
688  `client_collation_id` bigint unsigned NOT NULL,
689  `connection_collation_id` bigint unsigned NOT NULL,
690  `schema_collation_id` bigint unsigned NOT NULL,
691  `options` mediumtext COLLATE utf8_bin,
692  PRIMARY KEY (`id`),
693  UNIQUE KEY `schema_id` (`schema_id`,`name`),
694  UNIQUE KEY `table_id` (`table_id`,`event_type`,`action_timing`,`action_order`),
695  KEY `client_collation_id` (`client_collation_id`),
696  KEY `connection_collation_id` (`connection_collation_id`),
697  KEY `schema_collation_id` (`schema_collation_id`),
698  CONSTRAINT `triggers_ibfk_1` FOREIGN KEY (`schema_id`) REFERENCES `schemata` (`id`),
699  CONSTRAINT `triggers_ibfk_2` FOREIGN KEY (`table_id`) REFERENCES `tables` (`id`),
700  CONSTRAINT `triggers_ibfk_3` FOREIGN KEY (`client_collation_id`) REFERENCES `collations` (`id`),
701  CONSTRAINT `triggers_ibfk_4` FOREIGN KEY (`connection_collation_id`) REFERENCES `collations` (`id`),
702  CONSTRAINT `triggers_ibfk_5` FOREIGN KEY (`schema_collation_id`) REFERENCES `collations` (`id`)
703) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
704view_routine_usage	CREATE TABLE `view_routine_usage` (
705  `view_id` bigint unsigned NOT NULL,
706  `routine_catalog` varchar(64) <LCTN dependent collation> NOT NULL,
707  `routine_schema` varchar(64) <LCTN dependent collation> NOT NULL,
708  `routine_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
709  PRIMARY KEY (`view_id`,`routine_catalog`,`routine_schema`,`routine_name`),
710  KEY `routine_catalog` (`routine_catalog`,`routine_schema`,`routine_name`),
711  CONSTRAINT `view_routine_usage_ibfk_1` FOREIGN KEY (`view_id`) REFERENCES `tables` (`id`)
712) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
713view_table_usage	CREATE TABLE `view_table_usage` (
714  `view_id` bigint unsigned NOT NULL,
715  `table_catalog` varchar(64) <LCTN dependent collation> NOT NULL,
716  `table_schema` varchar(64) <LCTN dependent collation> NOT NULL,
717  `table_name` varchar(64) <LCTN dependent collation> NOT NULL,
718  PRIMARY KEY (`view_id`,`table_catalog`,`table_schema`,`table_name`),
719  KEY `table_catalog` (`table_catalog`,`table_schema`,`table_name`),
720  CONSTRAINT `view_table_usage_ibfk_1` FOREIGN KEY (`view_id`) REFERENCES `tables` (`id`)
721) /*!50100 TABLESPACE `mysql` */ ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 ROW_FORMAT=DYNAMIC
722SET debug = '-d,skip_dd_table_access_check';
723# PART 4
724########################################################################
725# Create a checksum associated with the current DD version. Compare this
726# with an already recorded checksum.
727########################################################################
728SET debug = '+d,skip_dd_table_access_check';
729Warnings:
730Warning	1681	Integer display width is deprecated and will be removed in a future release.
731include/assert.inc [The group concat max length is sufficient.]
732CHECK_STATUS
733The schema checksum corresponds to DD version 80021.
734include/assert.inc [The schema checksum corresponds to a known DD version.]
735