Merge lp:~percona-toolkit-dev/percona-toolkit/add-sandbox-for-5.7-1403900 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.13

Proposed by Frank Cizmich
Status: Merged
Approved by: Daniel Nichter
Approved revision: 612
Merged at revision: 612
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/add-sandbox-for-5.7-1403900
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.13
Diff against target: 220 lines (+181/-2)
3 files modified
sandbox/sakila.sql (+3/-2)
sandbox/servers/5.7/my.sandbox.cnf (+29/-0)
sandbox/servers/5.7/system_idb_tables.sql (+149/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/add-sandbox-for-5.7-1403900
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+245154@code.launchpad.net

Description of the change

Added new config file and system tables creation files specific for MySQL 5.7
Also tweaked a couple of sakila tables so they work with the new default sql_mode's

To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Should work. Perhaps it's time PT looks at modernizing this. Long time ago we sandboxed MySQL, and rolled our own sandboxing scripts. Today we should probably using VMs/virtualization, or something less hackish and more standard.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'sandbox/sakila.sql'
--- sandbox/sakila.sql 2012-12-05 22:05:41 +0000
+++ sandbox/sakila.sql 2014-12-18 19:51:36 +0000
@@ -6,6 +6,7 @@
6SET UNIQUE_CHECKS=0;6SET UNIQUE_CHECKS=0;
7SET FOREIGN_KEY_CHECKS=0;7SET FOREIGN_KEY_CHECKS=0;
88
9
9CREATE TABLE `actor` (10CREATE TABLE `actor` (
10 `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,11 `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
11 `first_name` varchar(45) NOT NULL,12 `first_name` varchar(45) NOT NULL,
@@ -370,7 +371,7 @@
370FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id371FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id
371 JOIN film_actor ON film.film_id = film_actor.film_id372 JOIN film_actor ON film.film_id = film_actor.film_id
372 JOIN actor ON film_actor.actor_id = actor.actor_id373 JOIN actor ON film_actor.actor_id = actor.actor_id
373GROUP BY film.film_id;374GROUP BY film.film_id, category.name;
374375
375CREATE VIEW nicer_but_slower_film_list376CREATE VIEW nicer_but_slower_film_list
376AS377AS
@@ -381,7 +382,7 @@
381FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id382FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id
382 JOIN film_actor ON film.film_id = film_actor.film_id383 JOIN film_actor ON film.film_id = film_actor.film_id
383 JOIN actor ON film_actor.actor_id = actor.actor_id384 JOIN actor ON film_actor.actor_id = actor.actor_id
384GROUP BY film.film_id;385GROUP BY film.film_id, category.name;
385386
386CREATE VIEW staff_list387CREATE VIEW staff_list
387AS388AS
388389
=== added directory 'sandbox/servers/5.7'
=== added file 'sandbox/servers/5.7/data.tar.gz'
389Binary files sandbox/servers/5.7/data.tar.gz 1970-01-01 00:00:00 +0000 and sandbox/servers/5.7/data.tar.gz 2014-12-18 19:51:36 +0000 differ390Binary files sandbox/servers/5.7/data.tar.gz 1970-01-01 00:00:00 +0000 and sandbox/servers/5.7/data.tar.gz 2014-12-18 19:51:36 +0000 differ
=== added file 'sandbox/servers/5.7/my.sandbox.cnf'
--- sandbox/servers/5.7/my.sandbox.cnf 1970-01-01 00:00:00 +0000
+++ sandbox/servers/5.7/my.sandbox.cnf 2014-12-18 19:51:36 +0000
@@ -0,0 +1,29 @@
1[client]
2user = msandbox
3password = msandbox
4port = PORT
5socket = /tmp/PORT/mysql_sandboxPORT.sock
6
7[mysqld]
8port = PORT
9socket = /tmp/PORT/mysql_sandboxPORT.sock
10pid-file = /tmp/PORT/data/mysql_sandboxPORT.pid
11basedir = PERCONA_TOOLKIT_SANDBOX
12datadir = /tmp/PORT/data
13key_buffer_size = 16M
14innodb_buffer_pool_size = 16M
15innodb_data_home_dir = /tmp/PORT/data
16innodb_log_group_home_dir = /tmp/PORT/data
17innodb_data_file_path = ibdata1:10M:autoextend
18innodb_log_file_size = 5M
19log-bin = mysql-bin
20relay_log = mysql-relay-bin
21log_slave_updates
22server-id = PORT
23report-host = 127.0.0.1
24report-port = PORT
25log-error = /tmp/PORT/data/mysqld.log
26innodb_lock_wait_timeout = 3
27general_log
28general_log_file = genlog
29lower_case_table_names = 0
030
=== added file 'sandbox/servers/5.7/system_idb_tables.sql'
--- sandbox/servers/5.7/system_idb_tables.sql 1970-01-01 00:00:00 +0000
+++ sandbox/servers/5.7/system_idb_tables.sql 2014-12-18 19:51:36 +0000
@@ -0,0 +1,149 @@
1USE `mysql`;
2
3CREATE TABLE IF NOT EXISTS `innodb_index_stats` (
4 `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
5 `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
6 `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
7 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
8 `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
9 `stat_value` bigint(20) unsigned NOT NULL,
10 `sample_size` bigint(20) unsigned DEFAULT NULL,
11 `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
12 PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
13) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
14
15CREATE TABLE IF NOT EXISTS `innodb_table_stats` (
16 `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
17 `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
18 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
19 `n_rows` bigint(20) unsigned NOT NULL,
20 `clustered_index_size` bigint(20) unsigned NOT NULL,
21 `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,
22 PRIMARY KEY (`database_name`,`table_name`)
23) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
24
25CREATE TABLE IF NOT EXISTS `slave_master_info` (
26 `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file.',
27 `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.',
28 `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last read event.',
29 `Host` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The host name of the master.',
30 `User_name` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.',
31 `User_password` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.',
32 `Port` int(10) unsigned NOT NULL COMMENT 'The network port used to connect to the master.',
33 `Connect_retry` int(10) unsigned NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.',
34 `Enabled_ssl` tinyint(1) NOT NULL COMMENT 'Indicates whether the server supports SSL connections.',
35 `Ssl_ca` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.',
36 `Ssl_capath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.',
37 `Ssl_cert` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.',
38 `Ssl_cipher` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.',
39 `Ssl_key` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.',
40 `Ssl_verify_server_cert` tinyint(1) NOT NULL COMMENT 'Whether to verify the server certificate.',
41 `Heartbeat` float NOT NULL,
42 `Bind` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server',
43 `Ignored_server_ids` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs',
44 `Uuid` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.',
45 `Retry_count` bigint(20) unsigned NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.',
46 `Ssl_crl` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)',
47 `Ssl_crlpath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files',
48 `Enabled_auto_position` tinyint(1) NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.',
49 PRIMARY KEY (`Host`,`Port`)
50) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Master Information';
51
52CREATE TABLE IF NOT EXISTS `slave_relay_log_info` (
53 `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.',
54 `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',
55 `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.',
56 `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.',
57 `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.',
58 `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
59 `Number_of_workers` int(10) unsigned NOT NULL,
60 `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',
61 PRIMARY KEY (`Id`)
62) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';
63
64
65CREATE TABLE IF NOT EXISTS `slave_worker_info` (
66 `Id` int(10) unsigned NOT NULL,
67 `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
68 `Relay_log_pos` bigint(20) unsigned NOT NULL,
69 `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
70 `Master_log_pos` bigint(20) unsigned NOT NULL,
71 `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
72 `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL,
73 `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
74 `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL,
75 `Checkpoint_seqno` int(10) unsigned NOT NULL,
76 `Checkpoint_group_size` int(10) unsigned NOT NULL,
77 `Checkpoint_group_bitmap` blob NOT NULL,
78 PRIMARY KEY (`Id`)
79) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information';
80
81
82CREATE TABLE IF NOT EXISTS `help_category` (
83 `help_category_id` smallint(5) unsigned NOT NULL,
84 `name` char(64) NOT NULL,
85 `parent_category_id` smallint(5) unsigned DEFAULT NULL,
86 `url` text NOT NULL,
87 PRIMARY KEY (`help_category_id`),
88 UNIQUE KEY `name` (`name`)
89) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help categories';
90
91CREATE TABLE IF NOT EXISTS `help_keyword` (
92 `help_keyword_id` int(10) unsigned NOT NULL,
93 `name` char(64) NOT NULL,
94 PRIMARY KEY (`help_keyword_id`),
95 UNIQUE KEY `name` (`name`)
96) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help keywords';
97
98CREATE TABLE IF NOT EXISTS `help_relation` (
99 `help_topic_id` int(10) unsigned NOT NULL,
100 `help_keyword_id` int(10) unsigned NOT NULL,
101 PRIMARY KEY (`help_keyword_id`,`help_topic_id`)
102) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='keyword-topic relation';
103
104CREATE TABLE IF NOT EXISTS `help_topic` (
105 `help_topic_id` int(10) unsigned NOT NULL,
106 `name` char(64) NOT NULL,
107 `help_category_id` smallint(5) unsigned NOT NULL,
108 `description` text NOT NULL,
109 `example` text NOT NULL,
110 `url` text NOT NULL,
111 PRIMARY KEY (`help_topic_id`),
112 UNIQUE KEY `name` (`name`)
113) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help topics';
114
115CREATE TABLE IF NOT EXISTS `time_zone` (
116 `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
117 `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
118 PRIMARY KEY (`Time_zone_id`)
119) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zones';
120
121CREATE TABLE IF NOT EXISTS `time_zone_leap_second` (
122 `Transition_time` bigint(20) NOT NULL,
123 `Correction` int(11) NOT NULL,
124 PRIMARY KEY (`Transition_time`)
125) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Leap seconds information for time zones';
126
127CREATE TABLE IF NOT EXISTS `time_zone_name` (
128 `Name` char(64) NOT NULL,
129 `Time_zone_id` int(10) unsigned NOT NULL,
130 PRIMARY KEY (`Name`)
131) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone names';
132
133CREATE TABLE IF NOT EXISTS `time_zone_transition` (
134 `Time_zone_id` int(10) unsigned NOT NULL,
135 `Transition_time` bigint(20) NOT NULL,
136 `Transition_type_id` int(10) unsigned NOT NULL,
137 PRIMARY KEY (`Time_zone_id`,`Transition_time`)
138) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone transitions';
139
140CREATE TABLE IF NOT EXISTS `time_zone_transition_type` (
141 `Time_zone_id` int(10) unsigned NOT NULL,
142 `Transition_type_id` int(10) unsigned NOT NULL,
143 `Offset` int(11) NOT NULL DEFAULT '0',
144 `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0',
145 `Abbreviation` char(8) NOT NULL DEFAULT '',
146 PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
147) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone transition types';
148
149

Subscribers

People subscribed via source and target branches

to all changes: