Scripts: VTMD table [closes #122]

This commit is contained in:
kevg
2017-05-19 23:27:40 +03:00
committed by Aleksey Midenkov
parent abba11e6c4
commit 45f6acd296
41 changed files with 173 additions and 27 deletions

View File

@ -129,6 +129,16 @@ SET @create_innodb_index_stats="CREATE TABLE IF NOT EXISTS innodb_index_stats (
PRIMARY KEY (database_name, table_name, index_name, stat_name)
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0";
SET @create_vtmd_template="CREATE TABLE IF NOT EXISTS vtmd_template (
start BIGINT UNSIGNED GENERATED ALWAYS AS ROW START COMMENT 'TRX_ID of table lifetime start',
end BIGINT UNSIGNED GENERATED ALWAYS AS ROW END COMMENT 'TRX_ID of table lifetime end',
name VARCHAR(64) NOT NULL COMMENT 'Table name during period [start, end)',
frm_image BLOB NOT NULL COMMENT 'Table structure during period [start, end)',
col_renames BLOB COMMENT 'Column name mapping from previous lifetime',
PERIOD FOR SYSTEM_TIME(start, end),
PRIMARY KEY (end)
) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0 WITH SYSTEM VERSIONING";
SET @str=IF(@have_innodb <> 0, @create_innodb_table_stats, "SET @dummy = 0");
PREPARE stmt FROM @str;
EXECUTE stmt;
@ -139,6 +149,11 @@ PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
SET @str=IF(@have_innodb <> 0, @create_vtmd_template, "SET @dummy = 0");
PREPARE stmt FROM @str;
EXECUTE stmt;
DROP PREPARE stmt;
SET @cmd="CREATE TABLE IF NOT EXISTS slave_relay_log_info (
Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',