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
1=== modified file 'sandbox/sakila.sql'
2--- sandbox/sakila.sql 2012-12-05 22:05:41 +0000
3+++ sandbox/sakila.sql 2014-12-18 19:51:36 +0000
4@@ -6,6 +6,7 @@
5 SET UNIQUE_CHECKS=0;
6 SET FOREIGN_KEY_CHECKS=0;
7
8+
9 CREATE TABLE `actor` (
10 `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
11 `first_name` varchar(45) NOT NULL,
12@@ -370,7 +371,7 @@
13 FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id
14 JOIN film_actor ON film.film_id = film_actor.film_id
15 JOIN actor ON film_actor.actor_id = actor.actor_id
16-GROUP BY film.film_id;
17+GROUP BY film.film_id, category.name;
18
19 CREATE VIEW nicer_but_slower_film_list
20 AS
21@@ -381,7 +382,7 @@
22 FROM category LEFT JOIN film_category ON category.category_id = film_category.category_id LEFT JOIN film ON film_category.film_id = film.film_id
23 JOIN film_actor ON film.film_id = film_actor.film_id
24 JOIN actor ON film_actor.actor_id = actor.actor_id
25-GROUP BY film.film_id;
26+GROUP BY film.film_id, category.name;
27
28 CREATE VIEW staff_list
29 AS
30
31=== added directory 'sandbox/servers/5.7'
32=== added file 'sandbox/servers/5.7/data.tar.gz'
33Binary 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
34=== added file 'sandbox/servers/5.7/my.sandbox.cnf'
35--- sandbox/servers/5.7/my.sandbox.cnf 1970-01-01 00:00:00 +0000
36+++ sandbox/servers/5.7/my.sandbox.cnf 2014-12-18 19:51:36 +0000
37@@ -0,0 +1,29 @@
38+[client]
39+user = msandbox
40+password = msandbox
41+port = PORT
42+socket = /tmp/PORT/mysql_sandboxPORT.sock
43+
44+[mysqld]
45+port = PORT
46+socket = /tmp/PORT/mysql_sandboxPORT.sock
47+pid-file = /tmp/PORT/data/mysql_sandboxPORT.pid
48+basedir = PERCONA_TOOLKIT_SANDBOX
49+datadir = /tmp/PORT/data
50+key_buffer_size = 16M
51+innodb_buffer_pool_size = 16M
52+innodb_data_home_dir = /tmp/PORT/data
53+innodb_log_group_home_dir = /tmp/PORT/data
54+innodb_data_file_path = ibdata1:10M:autoextend
55+innodb_log_file_size = 5M
56+log-bin = mysql-bin
57+relay_log = mysql-relay-bin
58+log_slave_updates
59+server-id = PORT
60+report-host = 127.0.0.1
61+report-port = PORT
62+log-error = /tmp/PORT/data/mysqld.log
63+innodb_lock_wait_timeout = 3
64+general_log
65+general_log_file = genlog
66+lower_case_table_names = 0
67
68=== added file 'sandbox/servers/5.7/system_idb_tables.sql'
69--- sandbox/servers/5.7/system_idb_tables.sql 1970-01-01 00:00:00 +0000
70+++ sandbox/servers/5.7/system_idb_tables.sql 2014-12-18 19:51:36 +0000
71@@ -0,0 +1,149 @@
72+USE `mysql`;
73+
74+CREATE TABLE IF NOT EXISTS `innodb_index_stats` (
75+ `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
76+ `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
77+ `index_name` varchar(64) COLLATE utf8_bin NOT NULL,
78+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
79+ `stat_name` varchar(64) COLLATE utf8_bin NOT NULL,
80+ `stat_value` bigint(20) unsigned NOT NULL,
81+ `sample_size` bigint(20) unsigned DEFAULT NULL,
82+ `stat_description` varchar(1024) COLLATE utf8_bin NOT NULL,
83+ PRIMARY KEY (`database_name`,`table_name`,`index_name`,`stat_name`)
84+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
85+
86+CREATE TABLE IF NOT EXISTS `innodb_table_stats` (
87+ `database_name` varchar(64) COLLATE utf8_bin NOT NULL,
88+ `table_name` varchar(64) COLLATE utf8_bin NOT NULL,
89+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
90+ `n_rows` bigint(20) unsigned NOT NULL,
91+ `clustered_index_size` bigint(20) unsigned NOT NULL,
92+ `sum_of_other_index_sizes` bigint(20) unsigned NOT NULL,
93+ PRIMARY KEY (`database_name`,`table_name`)
94+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0;
95+
96+CREATE TABLE IF NOT EXISTS `slave_master_info` (
97+ `Number_of_lines` int(10) unsigned NOT NULL COMMENT 'Number of lines in the file.',
98+ `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.',
99+ `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last read event.',
100+ `Host` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The host name of the master.',
101+ `User_name` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.',
102+ `User_password` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.',
103+ `Port` int(10) unsigned NOT NULL COMMENT 'The network port used to connect to the master.',
104+ `Connect_retry` int(10) unsigned NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.',
105+ `Enabled_ssl` tinyint(1) NOT NULL COMMENT 'Indicates whether the server supports SSL connections.',
106+ `Ssl_ca` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.',
107+ `Ssl_capath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.',
108+ `Ssl_cert` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.',
109+ `Ssl_cipher` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.',
110+ `Ssl_key` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.',
111+ `Ssl_verify_server_cert` tinyint(1) NOT NULL COMMENT 'Whether to verify the server certificate.',
112+ `Heartbeat` float NOT NULL,
113+ `Bind` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server',
114+ `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',
115+ `Uuid` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.',
116+ `Retry_count` bigint(20) unsigned NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.',
117+ `Ssl_crl` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)',
118+ `Ssl_crlpath` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files',
119+ `Enabled_auto_position` tinyint(1) NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.',
120+ PRIMARY KEY (`Host`,`Port`)
121+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Master Information';
122+
123+CREATE TABLE IF NOT EXISTS `slave_relay_log_info` (
124+ `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.',
125+ `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.',
126+ `Relay_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The relay log position of the last executed event.',
127+ `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.',
128+ `Master_log_pos` bigint(20) unsigned NOT NULL COMMENT 'The master log position of the last executed event.',
129+ `Sql_delay` int(11) NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.',
130+ `Number_of_workers` int(10) unsigned NOT NULL,
131+ `Id` int(10) unsigned NOT NULL COMMENT 'Internal Id that uniquely identifies this record.',
132+ PRIMARY KEY (`Id`)
133+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Relay Log Information';
134+
135+
136+CREATE TABLE IF NOT EXISTS `slave_worker_info` (
137+ `Id` int(10) unsigned NOT NULL,
138+ `Relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
139+ `Relay_log_pos` bigint(20) unsigned NOT NULL,
140+ `Master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
141+ `Master_log_pos` bigint(20) unsigned NOT NULL,
142+ `Checkpoint_relay_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
143+ `Checkpoint_relay_log_pos` bigint(20) unsigned NOT NULL,
144+ `Checkpoint_master_log_name` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
145+ `Checkpoint_master_log_pos` bigint(20) unsigned NOT NULL,
146+ `Checkpoint_seqno` int(10) unsigned NOT NULL,
147+ `Checkpoint_group_size` int(10) unsigned NOT NULL,
148+ `Checkpoint_group_bitmap` blob NOT NULL,
149+ PRIMARY KEY (`Id`)
150+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Worker Information';
151+
152+
153+CREATE TABLE IF NOT EXISTS `help_category` (
154+ `help_category_id` smallint(5) unsigned NOT NULL,
155+ `name` char(64) NOT NULL,
156+ `parent_category_id` smallint(5) unsigned DEFAULT NULL,
157+ `url` text NOT NULL,
158+ PRIMARY KEY (`help_category_id`),
159+ UNIQUE KEY `name` (`name`)
160+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help categories';
161+
162+CREATE TABLE IF NOT EXISTS `help_keyword` (
163+ `help_keyword_id` int(10) unsigned NOT NULL,
164+ `name` char(64) NOT NULL,
165+ PRIMARY KEY (`help_keyword_id`),
166+ UNIQUE KEY `name` (`name`)
167+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help keywords';
168+
169+CREATE TABLE IF NOT EXISTS `help_relation` (
170+ `help_topic_id` int(10) unsigned NOT NULL,
171+ `help_keyword_id` int(10) unsigned NOT NULL,
172+ PRIMARY KEY (`help_keyword_id`,`help_topic_id`)
173+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='keyword-topic relation';
174+
175+CREATE TABLE IF NOT EXISTS `help_topic` (
176+ `help_topic_id` int(10) unsigned NOT NULL,
177+ `name` char(64) NOT NULL,
178+ `help_category_id` smallint(5) unsigned NOT NULL,
179+ `description` text NOT NULL,
180+ `example` text NOT NULL,
181+ `url` text NOT NULL,
182+ PRIMARY KEY (`help_topic_id`),
183+ UNIQUE KEY `name` (`name`)
184+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='help topics';
185+
186+CREATE TABLE IF NOT EXISTS `time_zone` (
187+ `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
188+ `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
189+ PRIMARY KEY (`Time_zone_id`)
190+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zones';
191+
192+CREATE TABLE IF NOT EXISTS `time_zone_leap_second` (
193+ `Transition_time` bigint(20) NOT NULL,
194+ `Correction` int(11) NOT NULL,
195+ PRIMARY KEY (`Transition_time`)
196+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Leap seconds information for time zones';
197+
198+CREATE TABLE IF NOT EXISTS `time_zone_name` (
199+ `Name` char(64) NOT NULL,
200+ `Time_zone_id` int(10) unsigned NOT NULL,
201+ PRIMARY KEY (`Name`)
202+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone names';
203+
204+CREATE TABLE IF NOT EXISTS `time_zone_transition` (
205+ `Time_zone_id` int(10) unsigned NOT NULL,
206+ `Transition_time` bigint(20) NOT NULL,
207+ `Transition_type_id` int(10) unsigned NOT NULL,
208+ PRIMARY KEY (`Time_zone_id`,`Transition_time`)
209+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone transitions';
210+
211+CREATE TABLE IF NOT EXISTS `time_zone_transition_type` (
212+ `Time_zone_id` int(10) unsigned NOT NULL,
213+ `Transition_type_id` int(10) unsigned NOT NULL,
214+ `Offset` int(11) NOT NULL DEFAULT '0',
215+ `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0',
216+ `Abbreviation` char(8) NOT NULL DEFAULT '',
217+ PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
218+) ENGINE=InnoDB DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT='Time zone transition types';
219+
220+

Subscribers

People subscribed via source and target branches

to all changes: