Merge lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes into lp:percona-toolkit/2.1

Proposed by Daniel Nichter
Status: Merged
Merged at revision: 515
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes
Merge into: lp:percona-toolkit/2.1
Diff against target: 2464 lines (+1350/-241)
42 files modified
bin/pt-deadlock-logger (+6/-3)
bin/pt-duplicate-key-checker (+36/-18)
bin/pt-fk-error-logger (+5/-1)
bin/pt-index-usage (+36/-18)
bin/pt-mysql-summary (+4/-2)
bin/pt-table-checksum (+13/-7)
bin/pt-table-sync (+36/-18)
bin/pt-table-usage (+5/-1)
bin/pt-upgrade (+43/-2)
bin/pt-visual-explain (+5/-1)
lib/Sandbox.pm (+22/-4)
lib/SchemaIterator.pm (+9/-3)
lib/Transformers.pm (+4/-0)
sandbox/start-sandbox (+17/-2)
sandbox/test-env (+2/-3)
t/lib/ExplainAnalyzer.t (+3/-6)
t/lib/NibbleIterator.t (+2/-2)
t/lib/QueryReportFormatter.t (+9/-7)
t/lib/SchemaIterator.t (+2/-6)
t/lib/samples/QueryReportFormatter/report031.txt (+12/-0)
t/lib/samples/QueryReportFormatter/report032.txt (+58/-0)
t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt (+537/-0)
t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt (+48/-0)
t/lib/samples/stored-objs.sql (+30/-0)
t/pt-archiver/standard_options.t (+91/-65)
t/pt-find/pt-find.t (+77/-3)
t/pt-heartbeat/bugs.t (+2/-0)
t/pt-kill/basics.t (+2/-2)
t/pt-kill/kill.t (+2/-2)
t/pt-mysql-summary/pt-mysql-summary.t (+9/-6)
t/pt-online-schema-change/samples/bug_1045317.sql (+1/-1)
t/pt-query-digest/explain.t (+4/-8)
t/pt-query-digest/samples/issue_1196-output-5.6.txt (+62/-0)
t/pt-table-checksum/basics.t (+9/-12)
t/pt-table-checksum/error_handling.t (+3/-3)
t/pt-table-checksum/run_time.t (+1/-1)
t/pt-table-checksum/samples/default-results-5.6.txt (+41/-0)
t/pt-table-checksum/samples/repl-table-myisam.sql (+19/-0)
t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt (+41/-0)
t/pt-table-checksum/skip_innodb.t (+29/-12)
t/pt-table-sync/basics.t (+1/-1)
t/pt-upgrade/warnings.t (+12/-21)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes
Reviewer Review Type Date Requested Status
Brian Fraser (community) Approve
Daniel Nichter Approve
Review via email: mp+139822@code.launchpad.net
To post a comment you must log in.
505. By Brian Fraser

Added two missing config files fort/pt-config-diff/basics.t

506. By Brian Fraser

Merged pxc-pt-heartbeat

507. By Brian Fraser

Merged fix-886059-pt-heartbeat-timezones

508. By Brian Fraser

Merged fix-1082104-pt-deadlock-logger-username-dash

509. By Daniel Nichter

Set USER=jenkins if not set in util/jenkins-test.

510. By Daniel Nichter

Fix two possible sources of test errors.

511. By Daniel Nichter

Only run pt-ioprofile.t if the system has strace.

512. By Daniel Nichter

Add REFETCH_MYSQL to jenkins-test.

513. By Daniel Nichter

Fix REFETCH_MYSQL.

Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve
514. By Brian Fraser

Merged mysql-5.6-test-fixes and resolved conflicts

515. By Brian Fraser

pt-deadlock-logger: InnoDB timestamps have a different format in 5.6

516. By Brian Fraser

t/pt-heartbeat/bugs.t: Wait for test.heartbeat in slave1 before testing

517. By Brian Fraser

pt-deadlock-logger: use a character class instead of \p{Hex}

518. By Brian Fraser

pt-fk-error-logger: Deal with 5.6 InnoDB timestamps

519. By Brian Fraser

t/pt-find/pt-find.t: Update plan

520. By Daniel Nichter

Merge 2.1 r514, just a doc change.

Revision history for this message
Brian Fraser (fraserbn) :
review: Approve
521. By Daniel Nichter

Remove ndb_binlog_index from auto-skipped sys tables in SchemaIterator because it wasn't previously skipped in 5.1 and 5.5.

522. By Daniel Nichter

Update SchemaIterator.t sample files.

523. By Daniel Nichter

Make timing test more reasonable on fast systems.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-deadlock-logger'
2--- bin/pt-deadlock-logger 2012-12-14 01:47:50 +0000
3+++ bin/pt-deadlock-logger 2012-12-20 23:20:29 +0000
4@@ -3759,7 +3759,7 @@
5 my $n = qr/([^`\s]+)/; # MySQL object name
6 my $u = qr/(\S+)/; # Username. This is somewhat wrong, but
7 # usernames with spaces are rare enough.
8-my $s = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp
9+my $s = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)(?: [A-Fa-f0-9]+)?/; # InnoDB timestamp
10
11 # A thread's proc_info can be at least 98 different things I've found in the
12 # source. Fortunately, most of them begin with a gerunded verb. These are
13@@ -4140,8 +4140,11 @@
14
15 # Extract some miscellaneous data from the deadlock.
16 my ( $ts ) = $dl_text =~ m/^$s$/m;
17- my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/;
18- $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year + 2000, $mon, $day, $hour, $min, $sec);
19+ my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/;
20+ if ( length($year) == 2 ) {
21+ $year += 2000;
22+ }
23+ $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $day, $hour, $min, $sec);
24 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
25 $victim ||= 0;
26
27
28=== modified file 'bin/pt-duplicate-key-checker'
29--- bin/pt-duplicate-key-checker 2012-12-03 03:48:11 +0000
30+++ bin/pt-duplicate-key-checker 2012-12-20 23:20:29 +0000
31@@ -3026,11 +3026,16 @@
32
33 if ( !$self->{initialized} ) {
34 $self->{initialized} = 1;
35- if ( $self->{resume}->{tbl}
36- && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
37- PTDEBUG && _d('Will resume after',
38- join('.', @{$self->{resume}}{qw(db tbl)}));
39- $self->{resume}->{after} = 1;
40+ if ( $self->{resume}->{tbl} ) {
41+ if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
42+ PTDEBUG && _d('Will resume after',
43+ join('.', @{$self->{resume}}{qw(db tbl)}));
44+ $self->{resume}->{after}->{tbl} = 1;
45+ }
46+ if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
47+ PTDEBUG && _d('Will resume after', $self->{resume}->{db});
48+ $self->{resume}->{after}->{db} = 1;
49+ }
50 }
51 }
52
53@@ -3128,16 +3133,17 @@
54 if ( !defined $self->{dbs} ) {
55 my $sql = 'SHOW DATABASES';
56 PTDEBUG && _d($sql);
57- my @dbs = grep { $self->database_is_allowed($_) }
58- @{$dbh->selectcol_arrayref($sql)};
59+ my @dbs = grep {
60+ $self->_resume_from_database($_)
61+ &&
62+ $self->database_is_allowed($_)
63+ } @{$dbh->selectcol_arrayref($sql)};
64 PTDEBUG && _d('Found', scalar @dbs, 'databases');
65 $self->{dbs} = \@dbs;
66 }
67
68 if ( !$self->{db} ) {
69- do {
70- $self->{db} = shift @{$self->{dbs}};
71- } until $self->_resume_from_database($self->{db});
72+ $self->{db} = shift @{$self->{dbs}};
73 PTDEBUG && _d('Next database:', $self->{db});
74 return unless $self->{db};
75 }
76@@ -3239,9 +3245,15 @@
77
78 my $filter = $self->{filters};
79
80- if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {
81- return 0;
82- }
83+ return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
84+ general_log
85+ |slow_log
86+ |innodb_index_stats
87+ |innodb_table_stats
88+ |slave_master_info
89+ |slave_relay_log_info
90+ |slave_worker_info
91+ )$/x;
92
93 if ( $filter->{'ignore-tables'}->{$tbl}
94 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
95@@ -3310,11 +3322,17 @@
96 my ($self, $db) = @_;
97
98 return 1 unless $self->{resume}->{db};
99-
100 if ( $db eq $self->{resume}->{db} ) {
101- PTDEBUG && _d('At resume db', $db);
102- delete $self->{resume}->{db};
103- return 1;
104+ if ( !$self->{resume}->{after}->{db} ) {
105+ PTDEBUG && _d('Resuming from db', $db);
106+ delete $self->{resume}->{db};
107+ return 1;
108+ }
109+ else {
110+ PTDEBUG && _d('Resuming after db', $db);
111+ delete $self->{resume}->{db};
112+ delete $self->{resume}->{tbl};
113+ }
114 }
115
116 return 0;
117@@ -3326,7 +3344,7 @@
118 return 1 unless $self->{resume}->{tbl};
119
120 if ( $tbl eq $self->{resume}->{tbl} ) {
121- if ( !$self->{resume}->{after} ) {
122+ if ( !$self->{resume}->{after}->{tbl} ) {
123 PTDEBUG && _d('Resuming from table', $tbl);
124 delete $self->{resume}->{tbl};
125 return 1;
126
127=== modified file 'bin/pt-fk-error-logger'
128--- bin/pt-fk-error-logger 2012-12-03 03:48:11 +0000
129+++ bin/pt-fk-error-logger 2012-12-20 23:20:29 +0000
130@@ -1942,6 +1942,9 @@
131 . (defined $f ? '%09.6f' : '%02d'),
132 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
133 }
134+ elsif ( $val =~ m/^$proper_ts$/ ) {
135+ return $val;
136+ }
137 return $val;
138 }
139
140@@ -3609,7 +3612,8 @@
141 # Quick check if text even has a foreign key error.
142 return unless $text =~ m/LATEST FOREIGN KEY ERROR/;
143
144- my $idb_ts = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp
145+ # InnoDB timestamp
146+ my $idb_ts = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)/;
147
148 my ($ts, $fke) = $text =~ m/LATEST FOREIGN KEY ERROR.+?$idb_ts\s*(.+?)---/ms;
149 chomp $fke if $fke;
150
151=== modified file 'bin/pt-index-usage'
152--- bin/pt-index-usage 2012-12-03 03:48:11 +0000
153+++ bin/pt-index-usage 2012-12-20 23:20:29 +0000
154@@ -3844,11 +3844,16 @@
155
156 if ( !$self->{initialized} ) {
157 $self->{initialized} = 1;
158- if ( $self->{resume}->{tbl}
159- && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
160- PTDEBUG && _d('Will resume after',
161- join('.', @{$self->{resume}}{qw(db tbl)}));
162- $self->{resume}->{after} = 1;
163+ if ( $self->{resume}->{tbl} ) {
164+ if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
165+ PTDEBUG && _d('Will resume after',
166+ join('.', @{$self->{resume}}{qw(db tbl)}));
167+ $self->{resume}->{after}->{tbl} = 1;
168+ }
169+ if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
170+ PTDEBUG && _d('Will resume after', $self->{resume}->{db});
171+ $self->{resume}->{after}->{db} = 1;
172+ }
173 }
174 }
175
176@@ -3946,16 +3951,17 @@
177 if ( !defined $self->{dbs} ) {
178 my $sql = 'SHOW DATABASES';
179 PTDEBUG && _d($sql);
180- my @dbs = grep { $self->database_is_allowed($_) }
181- @{$dbh->selectcol_arrayref($sql)};
182+ my @dbs = grep {
183+ $self->_resume_from_database($_)
184+ &&
185+ $self->database_is_allowed($_)
186+ } @{$dbh->selectcol_arrayref($sql)};
187 PTDEBUG && _d('Found', scalar @dbs, 'databases');
188 $self->{dbs} = \@dbs;
189 }
190
191 if ( !$self->{db} ) {
192- do {
193- $self->{db} = shift @{$self->{dbs}};
194- } until $self->_resume_from_database($self->{db});
195+ $self->{db} = shift @{$self->{dbs}};
196 PTDEBUG && _d('Next database:', $self->{db});
197 return unless $self->{db};
198 }
199@@ -4057,9 +4063,15 @@
200
201 my $filter = $self->{filters};
202
203- if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {
204- return 0;
205- }
206+ return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
207+ general_log
208+ |slow_log
209+ |innodb_index_stats
210+ |innodb_table_stats
211+ |slave_master_info
212+ |slave_relay_log_info
213+ |slave_worker_info
214+ )$/x;
215
216 if ( $filter->{'ignore-tables'}->{$tbl}
217 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
218@@ -4128,11 +4140,17 @@
219 my ($self, $db) = @_;
220
221 return 1 unless $self->{resume}->{db};
222-
223 if ( $db eq $self->{resume}->{db} ) {
224- PTDEBUG && _d('At resume db', $db);
225- delete $self->{resume}->{db};
226- return 1;
227+ if ( !$self->{resume}->{after}->{db} ) {
228+ PTDEBUG && _d('Resuming from db', $db);
229+ delete $self->{resume}->{db};
230+ return 1;
231+ }
232+ else {
233+ PTDEBUG && _d('Resuming after db', $db);
234+ delete $self->{resume}->{db};
235+ delete $self->{resume}->{tbl};
236+ }
237 }
238
239 return 0;
240@@ -4144,7 +4162,7 @@
241 return 1 unless $self->{resume}->{tbl};
242
243 if ( $tbl eq $self->{resume}->{tbl} ) {
244- if ( !$self->{resume}->{after} ) {
245+ if ( !$self->{resume}->{after}->{tbl} ) {
246 PTDEBUG && _d('Resuming from table', $tbl);
247 delete $self->{resume}->{tbl};
248 return 1;
249
250=== modified file 'bin/pt-mysql-summary'
251--- bin/pt-mysql-summary 2012-12-06 00:10:22 +0000
252+++ bin/pt-mysql-summary 2012-12-20 23:20:29 +0000
253@@ -2332,8 +2332,10 @@
254
255 TOOL="pt-mysql-summary"
256
257-CMD_MYSQL="$(_which mysql)"
258-CMD_MYSQLDUMP="$( _which mysqldump )"
259+# These vars are declared earlier in the collect_mysql_info package,
260+# but if they're still undefined here, try to find them in PATH.
261+[ "$CMD_MYSQL" ] || CMD_MYSQL="$(_which mysql)"
262+[ "$CMD_MYSQLDUMP" ] || CMD_MYSQLDUMP="$( _which mysqldump )"
263
264 check_mysql () {
265 # Check that mysql and mysqldump are in PATH. If not, we're
266
267=== modified file 'bin/pt-table-checksum'
268--- bin/pt-table-checksum 2012-12-11 14:48:44 +0000
269+++ bin/pt-table-checksum 2012-12-20 23:20:29 +0000
270@@ -6986,9 +6986,15 @@
271
272 my $filter = $self->{filters};
273
274- if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {
275- return 0;
276- }
277+ return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
278+ general_log
279+ |slow_log
280+ |innodb_index_stats
281+ |innodb_table_stats
282+ |slave_master_info
283+ |slave_relay_log_info
284+ |slave_worker_info
285+ )$/x;
286
287 if ( $filter->{'ignore-tables'}->{$tbl}
288 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
289@@ -10123,9 +10129,9 @@
290 }
291 }
292 else {
293+ warn $EVAL_ERROR;
294 die "--replicate database $db does not exist and it cannot be "
295- . "created automatically. You need to create the database. "
296- . $EVAL_ERROR;
297+ . "created automatically. You need to create the database.\n";
298 }
299 }
300 }
301@@ -10193,9 +10199,9 @@
302 }
303 }
304 else {
305+ warn $EVAL_ERROR;
306 die "--replicate table $tbl does not exist and it cannot be "
307- . "created automatically. You need to create the table. "
308- . $EVAL_ERROR;
309+ . "created automatically. You need to create the table.\n"
310 }
311 }
312 }
313
314=== modified file 'bin/pt-table-sync'
315--- bin/pt-table-sync 2012-12-03 03:48:11 +0000
316+++ bin/pt-table-sync 2012-12-20 23:20:29 +0000
317@@ -7521,11 +7521,16 @@
318
319 if ( !$self->{initialized} ) {
320 $self->{initialized} = 1;
321- if ( $self->{resume}->{tbl}
322- && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
323- PTDEBUG && _d('Will resume after',
324- join('.', @{$self->{resume}}{qw(db tbl)}));
325- $self->{resume}->{after} = 1;
326+ if ( $self->{resume}->{tbl} ) {
327+ if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
328+ PTDEBUG && _d('Will resume after',
329+ join('.', @{$self->{resume}}{qw(db tbl)}));
330+ $self->{resume}->{after}->{tbl} = 1;
331+ }
332+ if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
333+ PTDEBUG && _d('Will resume after', $self->{resume}->{db});
334+ $self->{resume}->{after}->{db} = 1;
335+ }
336 }
337 }
338
339@@ -7623,16 +7628,17 @@
340 if ( !defined $self->{dbs} ) {
341 my $sql = 'SHOW DATABASES';
342 PTDEBUG && _d($sql);
343- my @dbs = grep { $self->database_is_allowed($_) }
344- @{$dbh->selectcol_arrayref($sql)};
345+ my @dbs = grep {
346+ $self->_resume_from_database($_)
347+ &&
348+ $self->database_is_allowed($_)
349+ } @{$dbh->selectcol_arrayref($sql)};
350 PTDEBUG && _d('Found', scalar @dbs, 'databases');
351 $self->{dbs} = \@dbs;
352 }
353
354 if ( !$self->{db} ) {
355- do {
356- $self->{db} = shift @{$self->{dbs}};
357- } until $self->_resume_from_database($self->{db});
358+ $self->{db} = shift @{$self->{dbs}};
359 PTDEBUG && _d('Next database:', $self->{db});
360 return unless $self->{db};
361 }
362@@ -7734,9 +7740,15 @@
363
364 my $filter = $self->{filters};
365
366- if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {
367- return 0;
368- }
369+ return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
370+ general_log
371+ |slow_log
372+ |innodb_index_stats
373+ |innodb_table_stats
374+ |slave_master_info
375+ |slave_relay_log_info
376+ |slave_worker_info
377+ )$/x;
378
379 if ( $filter->{'ignore-tables'}->{$tbl}
380 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
381@@ -7805,11 +7817,17 @@
382 my ($self, $db) = @_;
383
384 return 1 unless $self->{resume}->{db};
385-
386 if ( $db eq $self->{resume}->{db} ) {
387- PTDEBUG && _d('At resume db', $db);
388- delete $self->{resume}->{db};
389- return 1;
390+ if ( !$self->{resume}->{after}->{db} ) {
391+ PTDEBUG && _d('Resuming from db', $db);
392+ delete $self->{resume}->{db};
393+ return 1;
394+ }
395+ else {
396+ PTDEBUG && _d('Resuming after db', $db);
397+ delete $self->{resume}->{db};
398+ delete $self->{resume}->{tbl};
399+ }
400 }
401
402 return 0;
403@@ -7821,7 +7839,7 @@
404 return 1 unless $self->{resume}->{tbl};
405
406 if ( $tbl eq $self->{resume}->{tbl} ) {
407- if ( !$self->{resume}->{after} ) {
408+ if ( !$self->{resume}->{after}->{tbl} ) {
409 PTDEBUG && _d('Resuming from table', $tbl);
410 delete $self->{resume}->{tbl};
411 return 1;
412
413=== modified file 'bin/pt-table-usage'
414--- bin/pt-table-usage 2012-11-19 18:47:13 +0000
415+++ bin/pt-table-usage 2012-12-20 23:20:29 +0000
416@@ -212,7 +212,8 @@
417 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }
418 grep { defined $info->{$_} }
419 qw(F h P S A))
420- . ';mysql_read_default_group=client';
421+ . ';mysql_read_default_group=client'
422+ . ($info->{L} ? ';mysql_local_infile=1' : '');
423 }
424 PTDEBUG && _d($dsn);
425 return ($dsn, $info->{u}, $info->{p});
426@@ -241,6 +242,9 @@
427 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),
428 };
429 @{$defaults}{ keys %$opts } = values %$opts;
430+ if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension
431+ $defaults->{mysql_local_infile} = 1;
432+ }
433
434 if ( $opts->{mysql_use_result} ) {
435 $defaults->{mysql_use_result} = 1;
436
437=== modified file 'bin/pt-upgrade'
438--- bin/pt-upgrade 2012-12-03 03:48:11 +0000
439+++ bin/pt-upgrade 2012-12-20 23:20:29 +0000
440@@ -11980,7 +11980,8 @@
441 # ########################################################################
442 # Do the version-check
443 # ########################################################################
444- if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) {
445+ if ( $o->get('version-check') ne 'off'
446+ && (!$o->has('quiet') || !$o->get('quiet')) ) {
447 Pingback::version_check(
448 instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ],
449 protocol => $o->get('version-check'),
450@@ -11988,6 +11989,15 @@
451 }
452
453 # ########################################################################
454+ # Disable the query cache.
455+ # ########################################################################
456+ if ( $o->get('disable-query-cache') ) {
457+ foreach my $host ( @$hosts ) {
458+ disable_query_cache($host);
459+ }
460+ }
461+
462+ # ########################################################################
463 # Short version: do it! Long version: this callback does the main work.
464 # The big picture is:
465 # [event] -> exec on hosts -> compare -> aggregate -> [meta-event]
466@@ -12385,6 +12395,31 @@
467 return $dbh;
468 }
469
470+sub disable_query_cache {
471+ my ($host) = @_;
472+ die "I need a host argument" unless $host;
473+ my ($dbh, $host_name) = @{$host}{qw(dbh name)};
474+
475+ my $sql = 'SELECT @@query_cache_type';
476+ PTDEBUG && _d($host_name, $sql);
477+ my ($query_cache_type) = $dbh->selectrow_array($sql);
478+ PTDEBUG && _d($host_name, $query_cache_type);
479+ return if ($query_cache_type || '') =~ m/OFF|0/;
480+
481+ $sql = q/SET SESSION query_cache_type = OFF/;
482+ eval {
483+ PTDEBUG && _d($host_name, $sql);
484+ $dbh->do($sql);
485+ };
486+ if ( $EVAL_ERROR ) {
487+ warn $EVAL_ERROR;
488+ die "Failed to $sql on $host_name. Disable the query cache "
489+ . "manually, or specify --no-disable-query-cache.\n";
490+ }
491+
492+ return;
493+}
494+
495 # Catches signals so we can exit gracefully.
496 sub sig_int {
497 my ( $signal ) = @_;
498@@ -12693,6 +12728,12 @@
499 Fork to the background and detach from the shell. POSIX
500 operating systems only.
501
502+=item --[no]disable-query-cache
503+
504+default: yes
505+
506+C<SET SESSION query_cache_type = OFF> to disable the query cache.
507+
508 =item --explain-hosts
509
510 Print connection information and exit.
511@@ -12861,7 +12902,7 @@
512
513 =item --set-vars
514
515-type: string; default: wait_timeout=10000,query_cache_type=0
516+type: string; default: wait_timeout=10000
517
518 Set these MySQL variables. Immediately after connecting to MySQL, this
519 string will be appended to SET and executed.
520
521=== modified file 'bin/pt-visual-explain'
522--- bin/pt-visual-explain 2012-11-19 18:47:13 +0000
523+++ bin/pt-visual-explain 2012-12-20 23:20:29 +0000
524@@ -1900,7 +1900,8 @@
525 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }
526 grep { defined $info->{$_} }
527 qw(F h P S A))
528- . ';mysql_read_default_group=client';
529+ . ';mysql_read_default_group=client'
530+ . ($info->{L} ? ';mysql_local_infile=1' : '');
531 }
532 PTDEBUG && _d($dsn);
533 return ($dsn, $info->{u}, $info->{p});
534@@ -1929,6 +1930,9 @@
535 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),
536 };
537 @{$defaults}{ keys %$opts } = values %$opts;
538+ if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension
539+ $defaults->{mysql_local_infile} = 1;
540+ }
541
542 if ( $opts->{mysql_use_result} ) {
543 $defaults->{mysql_use_result} = 1;
544
545=== modified file 'lib/Sandbox.pm'
546--- lib/Sandbox.pm 2012-11-30 18:13:04 +0000
547+++ lib/Sandbox.pm 2012-12-20 23:20:29 +0000
548@@ -126,12 +126,13 @@
549 }
550
551 sub get_dbh_for {
552- my ( $self, $server, $cxn_ops ) = @_;
553+ my ( $self, $server, $cxn_ops, $user ) = @_;
554 _check_server($server);
555 $cxn_ops ||= { AutoCommit => 1 };
556+ $user ||= 'msandbox';
557 PTDEBUG && _d('dbh for', $server, 'on port', $port_for{$server});
558 my $dp = $self->{DSNParser};
559- my $dsn = $dp->parse('h=127.0.0.1,u=msandbox,p=msandbox,P=' . $port_for{$server});
560+ my $dsn = $dp->parse("h=127.0.0.1,u=$user,p=msandbox,P=" . $port_for{$server});
561 my $dbh;
562 # This is primarily for the benefit of CompareResults, but it's
563 # also quite convenient when using an affected OS
564@@ -335,11 +336,11 @@
565 my $master_dbh = $self->get_dbh_for($args{master} || 'master');
566 my $slave2_dbh = $self->get_dbh_for($args{slave} || 'slave2');
567 my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())");
568- $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1");
569+ $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1 /* wait_for_slaves */");
570 PerconaTest::wait_until(
571 sub {
572 my ($pong) = $slave2_dbh->selectrow_array(
573- "SELECT ping FROM percona_test.sentinel WHERE id=1");
574+ "SELECT ping FROM percona_test.sentinel WHERE id=1 /* wait_for_slaves */");
575 return $ping eq $pong;
576 }, undef, 300
577 );
578@@ -542,6 +543,23 @@
579 return "/tmp/$port/my.sandbox.cnf"
580 }
581
582+sub do_as_root {
583+ my ($self, $server, @queries) = @_;
584+ my $dbh = $self->get_dbh_for($server, undef, 'root');
585+ my $ok = 1;
586+ eval {
587+ foreach my $query ( @queries ) {
588+ $dbh->do($query);
589+ }
590+ };
591+ if ( $EVAL_ERROR ) {
592+ $ok = 0;
593+ warn $EVAL_ERROR;
594+ }
595+ $dbh->disconnect;
596+ return $ok;
597+}
598+
599 sub _d {
600 my ($package, undef, $line) = caller 0;
601 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
602
603=== modified file 'lib/SchemaIterator.pm'
604--- lib/SchemaIterator.pm 2012-12-05 23:30:29 +0000
605+++ lib/SchemaIterator.pm 2012-12-20 23:20:29 +0000
606@@ -444,9 +444,15 @@
607 my $filter = $self->{filters};
608
609 # Always auto-skip these pseudo tables.
610- if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {
611- return 0;
612- }
613+ return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
614+ general_log
615+ |slow_log
616+ |innodb_index_stats
617+ |innodb_table_stats
618+ |slave_master_info
619+ |slave_relay_log_info
620+ |slave_worker_info
621+ )$/x;
622
623 if ( $filter->{'ignore-tables'}->{$tbl}
624 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
625
626=== modified file 'lib/Transformers.pm'
627--- lib/Transformers.pm 2012-02-07 14:07:41 +0000
628+++ lib/Transformers.pm 2012-12-20 23:20:29 +0000
629@@ -193,6 +193,10 @@
630 . (defined $f ? '%09.6f' : '%02d'),
631 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
632 }
633+ # MySQL 5.6+ uses "proper" timestamps
634+ elsif ( $val =~ m/^$proper_ts$/ ) {
635+ return $val;
636+ }
637 return $val;
638 }
639
640
641=== modified file 'sandbox/servers/5.6/data.tar.gz'
642Binary files sandbox/servers/5.6/data.tar.gz 2012-10-16 15:13:19 +0000 and sandbox/servers/5.6/data.tar.gz 2012-12-20 23:20:29 +0000 differ
643=== modified file 'sandbox/start-sandbox'
644--- sandbox/start-sandbox 2012-12-11 21:43:45 +0000
645+++ sandbox/start-sandbox 2012-12-20 23:20:29 +0000
646@@ -34,7 +34,7 @@
647 cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port
648 tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port
649
650- for script in `ls $PERCONA_TOOLKIT_BRANCH/sandbox/servers/*`; do
651+ for script in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/"*; do
652 if [ -f $script ]; then
653 cp $script /tmp/$port
654 fi
655@@ -89,6 +89,9 @@
656 if [ -n "$SKIP_INNODB" ]; then
657 echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf
658 echo "default-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf
659+ if [ "$version" ">" "5.5" ]; then
660+ echo "default-tmp-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf
661+ fi
662 fi
663 if [ -n "$MODE_ANSI" ]; then
664 echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf
665@@ -99,6 +102,10 @@
666 if [ -n "$LOCAL_INFILE" ]; then
667 echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf
668 fi
669+ if [ -n "$QUERY_CACHE_SIZE" ]; then
670+ echo "query_cache_type=1" >> /tmp/$port/my.sandbox.cnf
671+ echo "query_cache_size=$QUERY_CACHE_SIZE" >> /tmp/$port/my.sandbox.cnf
672+ fi
673
674 # If the sandbox is a slave, set it read_only.
675 if [ "$type" = "slave" ]; then
676@@ -116,13 +123,21 @@
677 debug_sandbox $port
678 exit 1
679 fi
680+
681+ for sql in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/"*.sql; do
682+ [ -f "$sql" ] && /tmp/$port/use < $sql
683+ done
684 fi
685 else
686 echo "Sandbox $type $port failed to start." >&2
687 debug_sandbox $port
688 exit 1
689 fi
690-
691+
692+ /tmp/$port/use -e "CREATE DATABASE IF NOT EXISTS percona_test";
693+ /tmp/$port/use -e "CREATE TABLE IF NOT EXISTS percona_test.sentinel (id INT PRIMARY KEY, ping VARCHAR(64) NOT NULL DEFAULT '')";
694+ /tmp/$port/use -e "REPLACE INTO percona_test.sentinel (id, ping) VALUES (1, '')";
695+
696 # If the sandbox is a slave, start the slave.
697 if [ "$type" = "slave" ]; then
698 /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"
699
700=== modified file 'sandbox/test-env'
701--- sandbox/test-env 2012-12-11 21:43:45 +0000
702+++ sandbox/test-env 2012-12-20 23:20:29 +0000
703@@ -334,11 +334,10 @@
704 ../util/check-load-data
705
706 ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")
707- /tmp/12345/use -e "create table percona_test.sentinel(id int primary key, ping varchar(64) not null default '')"
708- /tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')";
709+ /tmp/12345/use -e "UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1";
710 echo -n "Waiting for replication to finish..."
711 for i in $(_seq 60); do
712- pong=$(/tmp/12347/use -ss -e 'select ping from percona_test.sentinel where id=1' 2>/dev/null)
713+ pong=$(/tmp/12347/use -ss -e 'SELECT ping FROM percona_test.sentinel WHERE id=1' 2>/dev/null)
714 [ "$ping" = "$pong" ] && break
715 echo -n '.'
716 sleep 1
717
718=== modified file 't/lib/ExplainAnalyzer.t'
719--- t/lib/ExplainAnalyzer.t 2012-06-03 17:54:32 +0000
720+++ t/lib/ExplainAnalyzer.t 2012-12-20 23:20:29 +0000
721@@ -31,9 +31,6 @@
722 if ( !$dbh ) {
723 plan skip_all => "Cannot connect to sandbox master";
724 }
725-else {
726- plan tests => 17;
727-}
728
729 $dbh->do('use sakila');
730
731@@ -60,7 +57,7 @@
732 key_len => 2,
733 ref => 'const',
734 rows => 1,
735- Extra => '',
736+ Extra => $sandbox_version eq '5.6' ? undef : '',
737 },
738 ],
739 'Got a simple EXPLAIN result',
740@@ -81,7 +78,7 @@
741 key_len => 2,
742 ref => 'const',
743 rows => 1,
744- Extra => '',
745+ Extra => $sandbox_version eq '5.6' ? undef : '',
746 },
747 ],
748 'Got EXPLAIN result for a DELETE',
749@@ -575,4 +572,4 @@
750 # Done.
751 # #############################################################################
752 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
753-exit;
754+done_testing;
755
756=== modified file 't/lib/NibbleIterator.t'
757--- t/lib/NibbleIterator.t 2012-11-28 22:00:30 +0000
758+++ t/lib/NibbleIterator.t 2012-12-20 23:20:29 +0000
759@@ -713,8 +713,8 @@
760 # ############################################################################
761 $ni = make_nibble_iter(
762 db => 'mysql',
763- tbl => 'host',
764- argv => [qw(--tables mysql.host --chunk-size-limit 0)],
765+ tbl => 'columns_priv',
766+ argv => [qw(--tables mysql.columns_priv --chunk-size-limit 0)],
767 );
768
769 @rows = ();
770
771=== modified file 't/lib/QueryReportFormatter.t'
772--- t/lib/QueryReportFormatter.t 2012-11-15 18:17:03 +0000
773+++ t/lib/QueryReportFormatter.t 2012-12-20 23:20:29 +0000
774@@ -1141,9 +1141,9 @@
775 );
776
777 my $explain = load_file(
778- $sandbox_version ge '5.1'
779- ? "t/lib/samples/QueryReportFormatter/report025.txt"
780- : "t/lib/samples/QueryReportFormatter/report026.txt");
781+ $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report031.txt"
782+ : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report025.txt"
783+ : "t/lib/samples/QueryReportFormatter/report026.txt");
784
785 is(
786 $qrf->explain_report("select * from qrf.t where i=2", 'qrf'),
787@@ -1180,11 +1180,13 @@
788 # so if it doesn't USE db then the EXPLAIN will fail. Here we reset
789 # the db to something else because we already called explain_report()
790 # above which did USE qrf.
791+ #
792+ # 5.6 really is that different: ia vs. TF>aI. It's smarter.
793 $dbh->do("USE mysql");
794 my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf');
795 is(
796 $explain_sparkline,
797- "TF>aI",
798+ $sandbox_version eq '5.6' ? "ia" : "TF>aI",
799 "explain_sparkling() uses db"
800 );
801
802@@ -1206,9 +1208,9 @@
803 groupby => 'fingerprint',
804 );
805 },
806- ($sandbox_version ge '5.1' ?
807- "t/lib/samples/QueryReportFormatter/report027.txt"
808- : "t/lib/samples/QueryReportFormatter/report029.txt"),
809+ ( $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report032.txt"
810+ : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report027.txt"
811+ : "t/lib/samples/QueryReportFormatter/report029.txt"),
812 ),
813 "EXPLAIN sparkline (issue 1141)"
814 );
815
816=== modified file 't/lib/SchemaIterator.t'
817--- t/lib/SchemaIterator.t 2012-12-05 23:30:29 +0000
818+++ t/lib/SchemaIterator.t 2012-12-20 23:20:29 +0000
819@@ -149,9 +149,7 @@
820 # Test simple, unfiltered get_db_itr().
821 # ########################################################################
822 test_so(
823- result => $sandbox_version ge '5.5' ? "$out/all-dbs-tbls.txt"
824- : $sandbox_version ge '5.1' ? "$out/all-dbs-tbls-5.1.txt"
825- : "$out/all-dbs-tbls-5.0.txt",
826+ result => "$out/all-dbs-tbls-$sandbox_version.txt",
827 test_name => "Iterate all schema objects with dbh",
828 );
829
830@@ -331,9 +329,7 @@
831 # ########################################################################
832 test_so(
833 filters => [qw(-t mysql.user)],
834- result => $sandbox_version ge '5.5' ? "$out/mysql-user-ddl-5.5.txt"
835- : $sandbox_version ge '5.1' ? "$out/mysql-user-ddl.txt"
836- : "$out/mysql-user-ddl-5.0.txt",
837+ result => "$out/mysql-user-ddl-$sandbox_version.txt",
838 test_name => "Get CREATE TABLE with dbh",
839 );
840
841
842=== added file 't/lib/samples/QueryReportFormatter/report031.txt'
843--- t/lib/samples/QueryReportFormatter/report031.txt 1970-01-01 00:00:00 +0000
844+++ t/lib/samples/QueryReportFormatter/report031.txt 2012-12-20 23:20:29 +0000
845@@ -0,0 +1,12 @@
846+# *************************** 1. row ***************************
847+# id: 1
848+# select_type: SIMPLE
849+# table: t
850+# partitions: NULL
851+# type: const
852+# possible_keys: PRIMARY
853+# key: PRIMARY
854+# key_len: 4
855+# ref: const
856+# rows: 1
857+# Extra: NULL
858
859=== added file 't/lib/samples/QueryReportFormatter/report032.txt'
860--- t/lib/samples/QueryReportFormatter/report032.txt 1970-01-01 00:00:00 +0000
861+++ t/lib/samples/QueryReportFormatter/report032.txt 2012-12-20 23:20:29 +0000
862@@ -0,0 +1,58 @@
863+
864+# Profile
865+# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
866+# ==== ================== ============= ===== ====== ==== ===== ======= =========
867+# 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 ia SELECT t
868+# MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS>
869+
870+# Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________
871+# Scores: Apdex = NS [0.0]*, V/M = 0.00
872+# EXPLAIN sparkline: ia
873+# Query_time sparkline: | ^ |
874+# Time range: all events occurred at 2009-12-08 09:23:49.637394
875+# Attribute pct total min max avg 95% stddev median
876+# ============ === ======= ======= ======= ======= ======= ======= =======
877+# Count 100 1
878+# Exec time 100 286us 286us 286us 286us 286us 0 286us
879+# Query size 100 90 90 90 90 90 0 90
880+# String:
881+# cmd Query
882+# Databases qrf
883+# Query_time distribution
884+# 1us
885+# 10us
886+# 100us ################################################################
887+# 1ms
888+# 10ms
889+# 100ms
890+# 1s
891+# 10s+
892+# Tables
893+# SHOW TABLE STATUS FROM `qrf` LIKE 't'\G
894+# SHOW CREATE TABLE `qrf`.`t`\G
895+# EXPLAIN /*!50100 PARTITIONS*/
896+select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i\G
897+# *************************** 1. row ***************************
898+# id: 1
899+# select_type: SIMPLE
900+# table: t1
901+# partitions: NULL
902+# type: index
903+# possible_keys: PRIMARY
904+# key: PRIMARY
905+# key_len: 4
906+# ref: NULL
907+# rows: 4
908+# Extra: Using where
909+# *************************** 2. row ***************************
910+# id: 1
911+# select_type: SIMPLE
912+# table: t2
913+# partitions: NULL
914+# type: ALL
915+# possible_keys: PRIMARY
916+# key: NULL
917+# key_len: NULL
918+# ref: NULL
919+# rows: 4
920+# Extra: Range checked for each record (index map: 0x1)
921
922=== renamed file 't/lib/samples/SchemaIterator/all-dbs-tbls.txt' => 't/lib/samples/SchemaIterator/all-dbs-tbls-5.5.txt'
923=== added file 't/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt'
924--- t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 1970-01-01 00:00:00 +0000
925+++ t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 2012-12-20 23:20:29 +0000
926@@ -0,0 +1,537 @@
927+mysql.columns_priv
928+CREATE TABLE `columns_priv` (
929+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
930+ `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
931+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
932+ `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
933+ `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
934+ `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
935+ `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
936+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
937+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
938+
939+mysql.db
940+CREATE TABLE `db` (
941+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
942+ `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
943+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
944+ `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
945+ `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
946+ `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
947+ `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
948+ `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
949+ `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
950+ `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
951+ `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
952+ `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
953+ `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
954+ `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
955+ `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
956+ `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
957+ `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
958+ `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
959+ `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
960+ `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
961+ `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
962+ `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
963+ PRIMARY KEY (`Host`,`Db`,`User`),
964+ KEY `User` (`User`)
965+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
966+
967+mysql.event
968+CREATE TABLE `event` (
969+ `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
970+ `name` char(64) NOT NULL DEFAULT '',
971+ `body` longblob NOT NULL,
972+ `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
973+ `execute_at` datetime DEFAULT NULL,
974+ `interval_value` int(11) DEFAULT NULL,
975+ `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') DEFAULT NULL,
976+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
977+ `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
978+ `last_executed` datetime DEFAULT NULL,
979+ `starts` datetime DEFAULT NULL,
980+ `ends` datetime DEFAULT NULL,
981+ `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
982+ `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
983+ `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','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
984+ `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
985+ `originator` int(10) unsigned NOT NULL,
986+ `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
987+ `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
988+ `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
989+ `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
990+ `body_utf8` longblob,
991+ PRIMARY KEY (`db`,`name`)
992+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
993+
994+mysql.func
995+CREATE TABLE `func` (
996+ `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
997+ `ret` tinyint(1) NOT NULL DEFAULT '0',
998+ `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
999+ `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
1000+ PRIMARY KEY (`name`)
1001+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
1002+
1003+mysql.help_category
1004+CREATE TABLE `help_category` (
1005+ `help_category_id` smallint(5) unsigned NOT NULL,
1006+ `name` char(64) NOT NULL,
1007+ `parent_category_id` smallint(5) unsigned DEFAULT NULL,
1008+ `url` char(128) NOT NULL,
1009+ PRIMARY KEY (`help_category_id`),
1010+ UNIQUE KEY `name` (`name`)
1011+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories'
1012+
1013+mysql.help_keyword
1014+CREATE TABLE `help_keyword` (
1015+ `help_keyword_id` int(10) unsigned NOT NULL,
1016+ `name` char(64) NOT NULL,
1017+ PRIMARY KEY (`help_keyword_id`),
1018+ UNIQUE KEY `name` (`name`)
1019+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords'
1020+
1021+mysql.help_relation
1022+CREATE TABLE `help_relation` (
1023+ `help_topic_id` int(10) unsigned NOT NULL,
1024+ `help_keyword_id` int(10) unsigned NOT NULL,
1025+ PRIMARY KEY (`help_keyword_id`,`help_topic_id`)
1026+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation'
1027+
1028+mysql.help_topic
1029+CREATE TABLE `help_topic` (
1030+ `help_topic_id` int(10) unsigned NOT NULL,
1031+ `name` char(64) NOT NULL,
1032+ `help_category_id` smallint(5) unsigned NOT NULL,
1033+ `description` text NOT NULL,
1034+ `example` text NOT NULL,
1035+ `url` char(128) NOT NULL,
1036+ PRIMARY KEY (`help_topic_id`),
1037+ UNIQUE KEY `name` (`name`)
1038+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics'
1039+
1040+mysql.ndb_binlog_index
1041+CREATE TABLE `ndb_binlog_index` (
1042+ `Position` bigint(20) unsigned NOT NULL,
1043+ `File` varchar(255) NOT NULL,
1044+ `epoch` bigint(20) unsigned NOT NULL,
1045+ `inserts` int(10) unsigned NOT NULL,
1046+ `updates` int(10) unsigned NOT NULL,
1047+ `deletes` int(10) unsigned NOT NULL,
1048+ `schemaops` int(10) unsigned NOT NULL,
1049+ `orig_server_id` int(10) unsigned NOT NULL,
1050+ `orig_epoch` bigint(20) unsigned NOT NULL,
1051+ `gci` int(10) unsigned NOT NULL,
1052+ PRIMARY KEY (`epoch`,`orig_server_id`,`orig_epoch`)
1053+) ENGINE=MyISAM DEFAULT CHARSET=latin1
1054+
1055+mysql.plugin
1056+CREATE TABLE `plugin` (
1057+ `name` varchar(64) NOT NULL DEFAULT '',
1058+ `dl` varchar(128) NOT NULL DEFAULT '',
1059+ PRIMARY KEY (`name`)
1060+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins'
1061+
1062+mysql.proc
1063+CREATE TABLE `proc` (
1064+ `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
1065+ `name` char(64) NOT NULL DEFAULT '',
1066+ `type` enum('FUNCTION','PROCEDURE') NOT NULL,
1067+ `specific_name` char(64) NOT NULL DEFAULT '',
1068+ `language` enum('SQL') NOT NULL DEFAULT 'SQL',
1069+ `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
1070+ `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
1071+ `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
1072+ `param_list` blob NOT NULL,
1073+ `returns` longblob NOT NULL,
1074+ `body` longblob NOT NULL,
1075+ `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
1076+ `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1077+ `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
1078+ `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','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
1079+ `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
1080+ `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
1081+ `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
1082+ `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
1083+ `body_utf8` longblob,
1084+ PRIMARY KEY (`db`,`name`,`type`)
1085+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
1086+
1087+mysql.procs_priv
1088+CREATE TABLE `procs_priv` (
1089+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1090+ `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
1091+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1092+ `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
1093+ `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
1094+ `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
1095+ `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
1096+ `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1097+ PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
1098+ KEY `Grantor` (`Grantor`)
1099+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
1100+
1101+mysql.proxies_priv
1102+CREATE TABLE `proxies_priv` (
1103+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1104+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1105+ `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1106+ `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1107+ `With_grant` tinyint(1) NOT NULL DEFAULT '0',
1108+ `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
1109+ `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1110+ PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
1111+ KEY `Grantor` (`Grantor`)
1112+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'
1113+
1114+mysql.servers
1115+CREATE TABLE `servers` (
1116+ `Server_name` char(64) NOT NULL DEFAULT '',
1117+ `Host` char(64) NOT NULL DEFAULT '',
1118+ `Db` char(64) NOT NULL DEFAULT '',
1119+ `Username` char(64) NOT NULL DEFAULT '',
1120+ `Password` char(64) NOT NULL DEFAULT '',
1121+ `Port` int(4) NOT NULL DEFAULT '0',
1122+ `Socket` char(64) NOT NULL DEFAULT '',
1123+ `Wrapper` char(64) NOT NULL DEFAULT '',
1124+ `Owner` char(64) NOT NULL DEFAULT '',
1125+ PRIMARY KEY (`Server_name`)
1126+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'
1127+
1128+mysql.tables_priv
1129+CREATE TABLE `tables_priv` (
1130+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1131+ `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
1132+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1133+ `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
1134+ `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
1135+ `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1136+ `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
1137+ `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
1138+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
1139+ KEY `Grantor` (`Grantor`)
1140+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
1141+
1142+mysql.time_zone
1143+CREATE TABLE `time_zone` (
1144+ `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
1145+ `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
1146+ PRIMARY KEY (`Time_zone_id`)
1147+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'
1148+
1149+mysql.time_zone_leap_second
1150+CREATE TABLE `time_zone_leap_second` (
1151+ `Transition_time` bigint(20) NOT NULL,
1152+ `Correction` int(11) NOT NULL,
1153+ PRIMARY KEY (`Transition_time`)
1154+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones'
1155+
1156+mysql.time_zone_name
1157+CREATE TABLE `time_zone_name` (
1158+ `Name` char(64) NOT NULL,
1159+ `Time_zone_id` int(10) unsigned NOT NULL,
1160+ PRIMARY KEY (`Name`)
1161+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names'
1162+
1163+mysql.time_zone_transition
1164+CREATE TABLE `time_zone_transition` (
1165+ `Time_zone_id` int(10) unsigned NOT NULL,
1166+ `Transition_time` bigint(20) NOT NULL,
1167+ `Transition_type_id` int(10) unsigned NOT NULL,
1168+ PRIMARY KEY (`Time_zone_id`,`Transition_time`)
1169+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions'
1170+
1171+mysql.time_zone_transition_type
1172+CREATE TABLE `time_zone_transition_type` (
1173+ `Time_zone_id` int(10) unsigned NOT NULL,
1174+ `Transition_type_id` int(10) unsigned NOT NULL,
1175+ `Offset` int(11) NOT NULL DEFAULT '0',
1176+ `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0',
1177+ `Abbreviation` char(8) NOT NULL DEFAULT '',
1178+ PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
1179+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types'
1180+
1181+mysql.user
1182+CREATE TABLE `user` (
1183+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1184+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1185+ `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
1186+ `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1187+ `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1188+ `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1189+ `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1190+ `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1191+ `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1192+ `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1193+ `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1194+ `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1195+ `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1196+ `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1197+ `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1198+ `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1199+ `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1200+ `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1201+ `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1202+ `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1203+ `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1204+ `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1205+ `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1206+ `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1207+ `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1208+ `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1209+ `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1210+ `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1211+ `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1212+ `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1213+ `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1214+ `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1215+ `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
1216+ `ssl_cipher` blob NOT NULL,
1217+ `x509_issuer` blob NOT NULL,
1218+ `x509_subject` blob NOT NULL,
1219+ `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
1220+ `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
1221+ `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
1222+ `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
1223+ `plugin` char(64) COLLATE utf8_bin DEFAULT '',
1224+ `authentication_string` text COLLATE utf8_bin,
1225+ `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1226+ PRIMARY KEY (`Host`,`User`)
1227+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
1228+
1229+percona_test.checksums
1230+CREATE TABLE `checksums` (
1231+ `db_tbl` varchar(128) NOT NULL,
1232+ `checksum` int(10) unsigned NOT NULL,
1233+ PRIMARY KEY (`db_tbl`)
1234+) ENGINE=InnoDB DEFAULT CHARSET=latin1
1235+
1236+percona_test.load_data
1237+CREATE TABLE `load_data` (
1238+ `i` int(11) DEFAULT NULL
1239+) ENGINE=InnoDB DEFAULT CHARSET=latin1
1240+
1241+percona_test.sentinel
1242+CREATE TABLE `sentinel` (
1243+ `id` int(11) NOT NULL,
1244+ `ping` varchar(64) NOT NULL DEFAULT '',
1245+ PRIMARY KEY (`id`)
1246+) ENGINE=InnoDB DEFAULT CHARSET=latin1
1247+
1248+sakila.actor
1249+CREATE TABLE `actor` (
1250+ `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1251+ `first_name` varchar(45) NOT NULL,
1252+ `last_name` varchar(45) NOT NULL,
1253+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1254+ PRIMARY KEY (`actor_id`),
1255+ KEY `idx_actor_last_name` (`last_name`)
1256+) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8
1257+
1258+sakila.address
1259+CREATE TABLE `address` (
1260+ `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1261+ `address` varchar(50) NOT NULL,
1262+ `address2` varchar(50) DEFAULT NULL,
1263+ `district` varchar(20) NOT NULL,
1264+ `city_id` smallint(5) unsigned NOT NULL,
1265+ `postal_code` varchar(10) DEFAULT NULL,
1266+ `phone` varchar(20) NOT NULL,
1267+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1268+ PRIMARY KEY (`address_id`),
1269+ KEY `idx_fk_city_id` (`city_id`),
1270+ CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE
1271+) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8
1272+
1273+sakila.category
1274+CREATE TABLE `category` (
1275+ `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
1276+ `name` varchar(25) NOT NULL,
1277+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1278+ PRIMARY KEY (`category_id`)
1279+) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8
1280+
1281+sakila.city
1282+CREATE TABLE `city` (
1283+ `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1284+ `city` varchar(50) NOT NULL,
1285+ `country_id` smallint(5) unsigned NOT NULL,
1286+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1287+ PRIMARY KEY (`city_id`),
1288+ KEY `idx_fk_country_id` (`country_id`),
1289+ CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE
1290+) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8
1291+
1292+sakila.country
1293+CREATE TABLE `country` (
1294+ `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1295+ `country` varchar(50) NOT NULL,
1296+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1297+ PRIMARY KEY (`country_id`)
1298+) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8
1299+
1300+sakila.customer
1301+CREATE TABLE `customer` (
1302+ `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1303+ `store_id` tinyint(3) unsigned NOT NULL,
1304+ `first_name` varchar(45) NOT NULL,
1305+ `last_name` varchar(45) NOT NULL,
1306+ `email` varchar(50) DEFAULT NULL,
1307+ `address_id` smallint(5) unsigned NOT NULL,
1308+ `active` tinyint(1) NOT NULL DEFAULT '1',
1309+ `create_date` datetime NOT NULL,
1310+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1311+ PRIMARY KEY (`customer_id`),
1312+ KEY `idx_fk_store_id` (`store_id`),
1313+ KEY `idx_fk_address_id` (`address_id`),
1314+ KEY `idx_last_name` (`last_name`),
1315+ CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE,
1316+ CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE
1317+) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8
1318+
1319+sakila.film
1320+CREATE TABLE `film` (
1321+ `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1322+ `title` varchar(255) NOT NULL,
1323+ `description` text,
1324+ `release_year` year(4) DEFAULT NULL,
1325+ `language_id` tinyint(3) unsigned NOT NULL,
1326+ `original_language_id` tinyint(3) unsigned DEFAULT NULL,
1327+ `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
1328+ `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
1329+ `length` smallint(5) unsigned DEFAULT NULL,
1330+ `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
1331+ `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G',
1332+ `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL,
1333+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1334+ PRIMARY KEY (`film_id`),
1335+ KEY `idx_title` (`title`),
1336+ KEY `idx_fk_language_id` (`language_id`),
1337+ KEY `idx_fk_original_language_id` (`original_language_id`),
1338+ CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE,
1339+ CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE
1340+) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8
1341+
1342+sakila.film_actor
1343+CREATE TABLE `film_actor` (
1344+ `actor_id` smallint(5) unsigned NOT NULL,
1345+ `film_id` smallint(5) unsigned NOT NULL,
1346+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1347+ PRIMARY KEY (`actor_id`,`film_id`),
1348+ KEY `idx_fk_film_id` (`film_id`),
1349+ CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE,
1350+ CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
1351+) ENGINE=InnoDB DEFAULT CHARSET=utf8
1352+
1353+sakila.film_category
1354+CREATE TABLE `film_category` (
1355+ `film_id` smallint(5) unsigned NOT NULL,
1356+ `category_id` tinyint(3) unsigned NOT NULL,
1357+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1358+ PRIMARY KEY (`film_id`,`category_id`),
1359+ KEY `fk_film_category_category` (`category_id`),
1360+ CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE,
1361+ CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE
1362+) ENGINE=InnoDB DEFAULT CHARSET=utf8
1363+
1364+sakila.film_text
1365+CREATE TABLE `film_text` (
1366+ `film_id` smallint(6) NOT NULL,
1367+ `title` varchar(255) NOT NULL,
1368+ `description` text,
1369+ PRIMARY KEY (`film_id`),
1370+ FULLTEXT KEY `idx_title_description` (`title`,`description`)
1371+) ENGINE=MyISAM DEFAULT CHARSET=utf8
1372+
1373+sakila.inventory
1374+CREATE TABLE `inventory` (
1375+ `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
1376+ `film_id` smallint(5) unsigned NOT NULL,
1377+ `store_id` tinyint(3) unsigned NOT NULL,
1378+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1379+ PRIMARY KEY (`inventory_id`),
1380+ KEY `idx_fk_film_id` (`film_id`),
1381+ KEY `idx_store_id_film_id` (`store_id`,`film_id`),
1382+ CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
1383+ CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
1384+) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8
1385+
1386+sakila.language
1387+CREATE TABLE `language` (
1388+ `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
1389+ `name` char(20) NOT NULL,
1390+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1391+ PRIMARY KEY (`language_id`)
1392+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
1393+
1394+sakila.payment
1395+CREATE TABLE `payment` (
1396+ `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
1397+ `customer_id` smallint(5) unsigned NOT NULL,
1398+ `staff_id` tinyint(3) unsigned NOT NULL,
1399+ `rental_id` int(11) DEFAULT NULL,
1400+ `amount` decimal(5,2) NOT NULL,
1401+ `payment_date` datetime NOT NULL,
1402+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1403+ PRIMARY KEY (`payment_id`),
1404+ KEY `idx_fk_staff_id` (`staff_id`),
1405+ KEY `idx_fk_customer_id` (`customer_id`),
1406+ KEY `fk_payment_rental` (`rental_id`),
1407+ CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE,
1408+ CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
1409+ CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
1410+) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8
1411+
1412+sakila.rental
1413+CREATE TABLE `rental` (
1414+ `rental_id` int(11) NOT NULL AUTO_INCREMENT,
1415+ `rental_date` datetime NOT NULL,
1416+ `inventory_id` mediumint(8) unsigned NOT NULL,
1417+ `customer_id` smallint(5) unsigned NOT NULL,
1418+ `return_date` datetime DEFAULT NULL,
1419+ `staff_id` tinyint(3) unsigned NOT NULL,
1420+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1421+ PRIMARY KEY (`rental_id`),
1422+ UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`),
1423+ KEY `idx_fk_inventory_id` (`inventory_id`),
1424+ KEY `idx_fk_customer_id` (`customer_id`),
1425+ KEY `idx_fk_staff_id` (`staff_id`),
1426+ CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
1427+ CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE,
1428+ CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE
1429+) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8
1430+
1431+sakila.staff
1432+CREATE TABLE `staff` (
1433+ `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
1434+ `first_name` varchar(45) NOT NULL,
1435+ `last_name` varchar(45) NOT NULL,
1436+ `address_id` smallint(5) unsigned NOT NULL,
1437+ `picture` blob,
1438+ `email` varchar(50) DEFAULT NULL,
1439+ `store_id` tinyint(3) unsigned NOT NULL,
1440+ `active` tinyint(1) NOT NULL DEFAULT '1',
1441+ `username` varchar(16) NOT NULL,
1442+ `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
1443+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1444+ PRIMARY KEY (`staff_id`),
1445+ KEY `idx_fk_store_id` (`store_id`),
1446+ KEY `idx_fk_address_id` (`address_id`),
1447+ CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
1448+ CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
1449+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
1450+
1451+sakila.store
1452+CREATE TABLE `store` (
1453+ `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
1454+ `manager_staff_id` tinyint(3) unsigned NOT NULL,
1455+ `address_id` smallint(5) unsigned NOT NULL,
1456+ `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1457+ PRIMARY KEY (`store_id`),
1458+ UNIQUE KEY `idx_unique_manager` (`manager_staff_id`),
1459+ KEY `idx_fk_address_id` (`address_id`),
1460+ CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
1461+ CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
1462+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
1463+
1464
1465=== renamed file 't/lib/samples/SchemaIterator/mysql-user-ddl.txt' => 't/lib/samples/SchemaIterator/mysql-user-ddl-5.1.txt'
1466=== added file 't/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt'
1467--- t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 1970-01-01 00:00:00 +0000
1468+++ t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 2012-12-20 23:20:29 +0000
1469@@ -0,0 +1,48 @@
1470+mysql.user
1471+CREATE TABLE `user` (
1472+ `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
1473+ `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
1474+ `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
1475+ `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1476+ `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1477+ `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1478+ `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1479+ `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1480+ `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1481+ `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1482+ `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1483+ `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1484+ `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1485+ `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1486+ `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1487+ `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1488+ `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1489+ `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1490+ `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1491+ `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1492+ `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1493+ `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1494+ `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1495+ `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1496+ `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1497+ `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1498+ `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1499+ `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1500+ `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1501+ `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1502+ `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1503+ `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1504+ `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
1505+ `ssl_cipher` blob NOT NULL,
1506+ `x509_issuer` blob NOT NULL,
1507+ `x509_subject` blob NOT NULL,
1508+ `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
1509+ `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
1510+ `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
1511+ `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
1512+ `plugin` char(64) COLLATE utf8_bin DEFAULT '',
1513+ `authentication_string` text COLLATE utf8_bin,
1514+ `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
1515+ PRIMARY KEY (`Host`,`User`)
1516+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
1517+
1518
1519=== added file 't/lib/samples/stored-objs.sql'
1520--- t/lib/samples/stored-objs.sql 1970-01-01 00:00:00 +0000
1521+++ t/lib/samples/stored-objs.sql 2012-12-20 23:20:29 +0000
1522@@ -0,0 +1,30 @@
1523+DROP DATABASE IF EXISTS pt_find;
1524+CREATE DATABASE pt_find;
1525+USE pt_find;
1526+
1527+create table t1 (
1528+ id int not null primary key
1529+) engine=innodb;
1530+
1531+create table t2 (
1532+ id int not null primary key
1533+) engine=innodb;
1534+
1535+CREATE FUNCTION hello (s CHAR(20))
1536+RETURNS CHAR(50) DETERMINISTIC
1537+RETURN CONCAT('Hello, ',s,'!');
1538+
1539+delimiter //
1540+
1541+CREATE PROCEDURE simpleproc (OUT param1 INT)
1542+BEGIN
1543+ SELECT COUNT(*) INTO param1 FROM t;
1544+END//
1545+
1546+CREATE TRIGGER ins_trg BEFORE INSERT ON t1
1547+ FOR EACH ROW BEGIN
1548+ INSERT INTO t2 VALUES (NEW.id);
1549+ END;
1550+//
1551+
1552+delimiter ;
1553
1554=== modified file 't/pt-archiver/standard_options.t'
1555--- t/pt-archiver/standard_options.t 2012-06-07 03:14:20 +0000
1556+++ t/pt-archiver/standard_options.t 2012-12-20 23:20:29 +0000
1557@@ -23,101 +23,127 @@
1558 if ( !$dbh ) {
1559 plan skip_all => 'Cannot connect to sandbox master';
1560 }
1561-else {
1562- plan tests => 7;
1563+elsif ( !$dbh2 ) {
1564+ plan skip_all => 'Cannot connect to sandbox slave';
1565 }
1566
1567 my $output;
1568-my $cnf = "/tmp/12345/my.sandbox.cnf";
1569-my $cmd = "$trunk/bin/pt-archiver";
1570+my $cnf = "/tmp/12345/my.sandbox.cnf";
1571+my $pid_file = "/tmp/pt-archiver-test.pid.$PID";
1572+my $sentinel = "/tmp/pt-archiver-test.sentinel.$PID";
1573
1574 $sb->create_dbs($dbh, [qw(test)]);
1575
1576-SKIP: {
1577- skip 'Sandbox master does not have the sakila database', 1
1578- unless @{$dbh->selectcol_arrayref("SHOW DATABASES LIKE 'sakila'")};
1579-
1580- $output = `$cmd --source F=$cnf,h=127.1,D=sakila,t=film --no-check-charset --where "film_id < 100" --purge --dry-run --port 12345 | diff $trunk/t/pt-archiver/samples/issue-248.txt -`;
1581- is(
1582- $output,
1583- '',
1584- 'DSNs inherit from standard connection options (issue 248)'
1585- );
1586-};
1587-
1588+ok(
1589+ no_diff(
1590+ sub {
1591+ pt_archiver::main('--source', "F=$cnf,h=127.1,D=sakila,t=film",
1592+ qw(--no-check-charset --purge --dry-run --port 12345),
1593+ "--where", "film_id < 100")
1594+ },
1595+ "t/pt-archiver/samples/issue-248.txt",
1596+ ),
1597+ 'DSNs inherit from standard connection options (issue 248)'
1598+);
1599
1600 # Test with a sentinel file
1601 $sb->load_file('master', 't/pt-archiver/samples/table1.sql');
1602-diag(`touch sentinel`);
1603+diag(`touch $sentinel`);
1604+
1605 $output = output(
1606- sub { pt_archiver::main(qw(--where 1=1 --why-quit --sentinel sentinel), "--source", "D=test,t=table_1,F=$cnf", qw(--purge)) },
1607-);
1608-like($output, qr/because sentinel/, 'Exits because of sentinel');
1609+ sub { pt_archiver::main("--source", "D=test,t=table_1,F=$cnf",
1610+ qw(--where 1=1 --why-quit --purge),
1611+ "--sentinel", $sentinel)
1612+ },
1613+ stderr => 1,
1614+);
1615+
1616+like(
1617+ $output,
1618+ qr/because sentinel file $sentinel exists/,
1619+ 'Exits because of sentinel'
1620+);
1621+
1622 $output = `/tmp/12345/use -N -e "select count(*) from test.table_1"`;
1623-is($output + 0, 4, 'No rows were deleted');
1624-`rm sentinel`;
1625+is(
1626+ $output + 0,
1627+ 4,
1628+ 'No rows were deleted'
1629+) or diag($output);
1630+
1631+diag(`rm -f $sentinel`);
1632
1633 # Test --stop, which sets the sentinel
1634 $output = output(
1635- sub { pt_archiver::main(qw(--sentinel sentinel --stop)) },
1636-);
1637-like($output, qr/Successfully created file sentinel/, 'Created the sentinel OK');
1638-diag(`rm -f sentinel >/dev/null`);
1639+ sub { pt_archiver::main("--sentinel", $sentinel, "--stop") },
1640+);
1641+
1642+like(
1643+ $output,
1644+ qr/Successfully created file $sentinel/,
1645+ 'Created the sentinel OK'
1646+);
1647+
1648+diag(`rm -f $sentinel`);
1649
1650 # #############################################################################
1651 # Issue 391: Add --pid option to mk-table-sync
1652 # #############################################################################
1653-`touch /tmp/mk-archiver.pid`;
1654-$output = `$cmd --where 1=1 --source F=$cnf,D=test,t=issue_131_src --statistics --dest t=issue_131_dst --pid /tmp/mk-archiver.pid 2>&1`;
1655+diag(`touch $pid_file`);
1656+
1657+$output = output(
1658+ sub { pt_archiver::main('--source', "F=$cnf,D=test,t=issue_131_src",
1659+ qw(--where 1=1 --statistics --dest t=issue_131_dst),
1660+ "--pid", $pid_file)
1661+ },
1662+ stderr => 1,
1663+);
1664+
1665 like(
1666 $output,
1667- qr{PID file /tmp/mk-archiver.pid already exists},
1668+ qr{PID file $pid_file already exists},
1669 'Dies if PID file already exists (issue 391)'
1670 );
1671
1672-`rm -rf /tmp/mk-archiver.pid`;
1673+diag(`rm -f $pid_file`);
1674
1675 # #############################################################################
1676 # Issue 460: mk-archiver does not inherit DSN as documented
1677 # #############################################################################
1678-SKIP: {
1679- skip 'Cannot connect to sandbox slave1', 1 unless $dbh2;
1680-
1681- # This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.
1682- $sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
1683-
1684- # Change passwords so defaults files won't work.
1685- $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('foo')");
1686- $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('foo')");
1687-
1688- $dbh2->do('TRUNCATE TABLE test.table_2');
1689-
1690- $output = `$trunk/bin/pt-archiver --where 1=1 --source h=127.1,P=12345,D=test,t=table_1,u=msandbox,p=foo --dest P=12346,t=table_2 2>&1`;
1691- my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2');
1692- is(
1693- scalar @$r,
1694- 4,
1695- '--dest inherited from --source'
1696- );
1697-
1698- # Set the passwords back. If this fails we should bail out because
1699- # nothing else is going to work.
1700- eval {
1701- $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')");
1702- $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')");
1703- };
1704- if ( $EVAL_ERROR ) {
1705- BAIL_OUT('Failed to reset the msandbox password on the master or slave '
1706- . 'sandbox. Check the Maatkit test environment with "test-env '
1707- . 'status" and restart with "test-env restart". The error was: '
1708- . $EVAL_ERROR);
1709- }
1710-};
1711+
1712+# This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.
1713+$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
1714+
1715+# Change passwords so defaults files won't work.
1716+$sb->do_as_root(
1717+ 'master',
1718+ q/CREATE USER 'bob'@'%' IDENTIFIED BY 'foo'/,
1719+ q/GRANT ALL ON *.* TO 'bob'@'%'/,
1720+);
1721+$dbh2->do('TRUNCATE TABLE test.table_2');
1722+$sb->wait_for_slaves;
1723+
1724+$output = output(
1725+ sub { pt_archiver::main(
1726+ '--source', 'h=127.1,P=12345,D=test,t=table_1,u=bob,p=foo',
1727+ '--dest', 'P=12346,t=table_2',
1728+ qw(--where 1=1))
1729+ },
1730+ stderr => 1,
1731+);
1732+
1733+my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2');
1734+is(
1735+ scalar @$r,
1736+ 4,
1737+ '--dest inherited from --source'
1738+);
1739+
1740+$sb->do_as_root('master', q/DROP USER 'bob'@'%'/);
1741
1742 # #############################################################################
1743 # Done.
1744 # #############################################################################
1745 $sb->wipe_clean($dbh);
1746-$sb->wipe_clean($dbh2) if $dbh2;
1747 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
1748-exit;
1749+done_testing;
1750
1751=== modified file 't/pt-find/pt-find.t'
1752--- t/pt-find/pt-find.t 2012-12-07 22:46:51 +0000
1753+++ t/pt-find/pt-find.t 2012-12-20 23:20:29 +0000
1754@@ -22,9 +22,8 @@
1755 if ( !$dbh ) {
1756 plan skip_all => 'Cannot connect to sandbox master';
1757 }
1758-else {
1759- plan tests => 23;
1760-}
1761+
1762+$sb->load_file('master', 't/lib/samples/stored-objs.sql');
1763
1764 my $output;
1765 my $cnf = '/tmp/12345/my.sandbox.cnf';
1766@@ -111,6 +110,80 @@
1767 "--view that doesn't match"
1768 );
1769
1770+ # Test --procedure.
1771+ $output = `$cmd pt_find --procedure param1 --print`;
1772+ is(
1773+ $output,
1774+ "`pt_find`.`PROCEDURE simpleproc`\n",
1775+ '--procedure that matches'
1776+ );
1777+
1778+ $output = `$cmd pt_find --procedure blah --print`;
1779+ is(
1780+ $output,
1781+ '',
1782+ "--procedure that doesn't match"
1783+ );
1784+
1785+ # Test --function.
1786+ $output = `$cmd pt_find --function Hello --print`;
1787+ is(
1788+ $output,
1789+ "`pt_find`.`FUNCTION hello`\n",
1790+ '--function that matches'
1791+ );
1792+
1793+ $output = `$cmd pt_find --function blah --print`;
1794+ is(
1795+ $output,
1796+ '',
1797+ "--function that doesn't match"
1798+ );
1799+
1800+ # Test --trigger without --trigger-table.
1801+ $output = `$cmd pt_find --trigger 'INSERT INTO t2' --print`;
1802+ is(
1803+ $output,
1804+ "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n",
1805+ '--trigger that matches without --trigger-table'
1806+ );
1807+
1808+ $output = `$cmd pt_find --trigger blah --print`;
1809+ is(
1810+ $output,
1811+ '',
1812+ "--trigger that doesn't match without --trigger-table"
1813+ );
1814+
1815+ # Test --trigger with --trigger-table.
1816+ $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table t1 --print`;
1817+ is(
1818+ $output,
1819+ "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n",
1820+ '--trigger that matches with matching --trigger-table'
1821+ );
1822+
1823+ $output = `$cmd pt_find --trigger blah --trigger-table t1 --print`;
1824+ is(
1825+ $output,
1826+ '',
1827+ "--trigger that doesn't match with matching --trigger-table"
1828+ );
1829+
1830+ $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table foo --print`;
1831+ is(
1832+ $output,
1833+ '',
1834+ '--trigger that matches with non-matching --trigger-table'
1835+ );
1836+
1837+ $output = `$cmd pt_find --trigger blah --trigger-table foo --print`;
1838+ is(
1839+ $output,
1840+ '',
1841+ "--trigger that doesn't match with non-matching --trigger-table"
1842+ );
1843+
1844 # Test NULL sizes.
1845 $output = `$cmd sakila --datasize NULL`,
1846 is(
1847@@ -223,4 +296,5 @@
1848 # #############################################################################
1849 $sb->wipe_clean($dbh);
1850 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
1851+done_testing;
1852 exit;
1853
1854=== modified file 't/pt-heartbeat/bugs.t'
1855--- t/pt-heartbeat/bugs.t 2012-12-13 16:20:48 +0000
1856+++ t/pt-heartbeat/bugs.t 2012-12-20 23:20:29 +0000
1857@@ -84,6 +84,8 @@
1858
1859 start_update_instance( $master_port );
1860
1861+PerconaTest::wait_for_table($slave1_dbh, 'test.heartbeat', 'server_id=12345');
1862+
1863 my $slave1_dsn = $sb->dsn_for('slave1');
1864 # Using full_output here to work around a Perl bug: Only the first explicit
1865 # tzset works.
1866
1867=== modified file 't/pt-kill/basics.t'
1868--- t/pt-kill/basics.t 2012-07-12 22:49:15 +0000
1869+++ t/pt-kill/basics.t 2012-12-20 23:20:29 +0000
1870@@ -35,7 +35,7 @@
1871
1872 # Shell out to a sleep(10) query and try to capture the query.
1873 # Backticks don't work here.
1874-system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5)' >/dev/null &");
1875+system("/tmp/12345/use -e 'select sleep(5)' >/dev/null &");
1876
1877 $output = `$cmd --busy-time 1s --print --run-time 10`;
1878
1879@@ -59,7 +59,7 @@
1880 # --iterations was 0, and another bug when --run-time was not respected.
1881 # Do it all over again, this time with --iterations 0.
1882 # Re issue 1181, --iterations no longer exists, but we'll still keep this test.
1883-system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(10)' >/dev/null&");
1884+system("/tmp/12345/use -e 'select sleep(10)' >/dev/null&");
1885 $output = `$cmd --busy-time 1s --print --run-time 11s`;
1886 @times = $output =~ m/\(Query (\d+) sec\)/g;
1887 ok(
1888
1889=== modified file 't/pt-kill/kill.t'
1890--- t/pt-kill/kill.t 2012-12-04 21:05:32 +0000
1891+++ t/pt-kill/kill.t 2012-12-20 23:20:29 +0000
1892@@ -35,7 +35,7 @@
1893 # TODO: These tests need something to match, so we background
1894 # a SLEEP(4) query and match that, but this isn't ideal because
1895 # it's time-based. Better is to use a specific db and --match-db.
1896-my $sys_cmd = "/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(4)' >/dev/null 2>&1 &";
1897+my $sys_cmd = "/tmp/12345/use -e 'select sleep(4)' >/dev/null 2>&1 &";
1898
1899 # #############################################################################
1900 # Test that --kill kills the connection.
1901@@ -83,7 +83,7 @@
1902 # Here's how this works. This cmd is going to try 2 queries on the same
1903 # connection: sleep5 and sleep3. --kill-query will kill sleep5 causing
1904 # sleep3 to start using the same connection id (pid).
1905-system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5); select sleep(3)' >/dev/null&");
1906+system("/tmp/12345/use -e 'select sleep(5); select sleep(3)' >/dev/null&");
1907 sleep 0.5;
1908 $rows = $dbh->selectall_hashref('show processlist', 'id');
1909 $pid = 0; # reuse, reset
1910
1911=== modified file 't/pt-mysql-summary/pt-mysql-summary.t'
1912--- t/pt-mysql-summary/pt-mysql-summary.t 2012-11-27 22:05:45 +0000
1913+++ t/pt-mysql-summary/pt-mysql-summary.t 2012-12-20 23:20:29 +0000
1914@@ -19,13 +19,18 @@
1915
1916 local $ENV{PTDEBUG} = "";
1917
1918+# mysqldump from earlier versions doesn't seem to work with 5.6,
1919+# so use the actual mysqldump from each MySQL bin which should
1920+# always be compatible with itself.
1921+my $env = qq\CMD_MYSQLDUMP="$ENV{PERCONA_TOOLKIT_SANDBOX}/bin/mysqldump"\;
1922+
1923 #
1924 # --save-samples
1925 #
1926
1927 my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 );
1928
1929-`$trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
1930+`$env $trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
1931
1932 ok(
1933 -e $dir,
1934@@ -41,13 +46,13 @@
1935 "And leaves all files in there"
1936 ) or diag($n_files, `ls -l $dir`);
1937
1938-undef($dir);
1939+undef($dir); # rm the dir because CLEANUP => 1
1940
1941 #
1942 # --databases
1943 #
1944
1945-my $out = `$trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
1946+my $out = `$env $trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
1947
1948 like(
1949 $out,
1950@@ -61,8 +66,7 @@
1951 no_diff(
1952 sub {
1953 local $ENV{_NO_FALSE_NEGATIVES} = 1;
1954- my $out = `$trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Skipping schema analysis/'`;
1955- print $out;
1956+ print `$env $trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Skipping schema analysis/'`
1957 },
1958 "t/pt-mysql-summary/samples/expected_output_temp00$i.txt",
1959 ),
1960@@ -82,4 +86,3 @@
1961 );
1962
1963 done_testing;
1964-exit;
1965
1966=== modified file 't/pt-online-schema-change/samples/bug_1045317.sql'
1967--- t/pt-online-schema-change/samples/bug_1045317.sql 2012-11-06 17:22:56 +0000
1968+++ t/pt-online-schema-change/samples/bug_1045317.sql 2012-12-20 23:20:29 +0000
1969@@ -6,5 +6,5 @@
1970 `val` ENUM('M','E','H') NOT NULL,
1971 PRIMARY KEY (`id`)
1972 );
1973-
1974 INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H');
1975+ANALYZE TABLE bits;
1976
1977=== modified file 't/pt-query-digest/explain.t'
1978--- t/pt-query-digest/explain.t 2012-11-21 16:58:40 +0000
1979+++ t/pt-query-digest/explain.t 2012-12-20 23:20:29 +0000
1980@@ -23,9 +23,6 @@
1981 if ( !$dbh ) {
1982 plan skip_all => 'Cannot connect to sandbox master';
1983 }
1984-else {
1985- plan tests => 6;
1986-}
1987
1988 my $sample = "t/pt-query-digest/samples/";
1989
1990@@ -90,7 +87,6 @@
1991 'Analysis for slow007 with --explain, failed',
1992 );
1993
1994-
1995 # #############################################################################
1996 # Issue 1196: mk-query-digest --explain is broken
1997 # #############################################################################
1998@@ -102,9 +98,9 @@
1999 '--report-format', 'profile,query_report',
2000 "$trunk/t/pt-query-digest/samples/issue_1196.log",)
2001 },
2002- ($sandbox_version ge '5.1'
2003- ? "t/pt-query-digest/samples/issue_1196-output.txt"
2004- : "t/pt-query-digest/samples/issue_1196-output-5.0.txt"),
2005+ ( $sandbox_version eq '5.6' ? "$sample/issue_1196-output-5.6.txt"
2006+ : $sandbox_version ge '5.1' ? "$sample/issue_1196-output.txt"
2007+ : "$sample/issue_1196-output-5.0.txt"),
2008 ),
2009 "--explain sparkline uses event db and doesn't crash ea (issue 1196"
2010 );
2011@@ -114,4 +110,4 @@
2012 # #############################################################################
2013 $sb->wipe_clean($dbh);
2014 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
2015-exit;
2016+done_testing;
2017
2018=== added file 't/pt-query-digest/samples/issue_1196-output-5.6.txt'
2019--- t/pt-query-digest/samples/issue_1196-output-5.6.txt 1970-01-01 00:00:00 +0000
2020+++ t/pt-query-digest/samples/issue_1196-output-5.6.txt 2012-12-20 23:20:29 +0000
2021@@ -0,0 +1,62 @@
2022+
2023+# Profile
2024+# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
2025+# ==== ================== ============= ===== ====== ==== ===== ======= ========
2026+# 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 1.00 0.00 TF>aa SELECT t
2027+
2028+# Query 1: 0 QPS, 0x concurrency, ID 0xD4B6A5CD2F2F485C at byte 0 ________
2029+# This item is included in the report because it matches --limit.
2030+# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
2031+# EXPLAIN sparkline: TF>aa
2032+# Query_time sparkline: | ^ |
2033+# Time range: all events occurred at 2010-12-14 16:12:28
2034+# Attribute pct total min max avg 95% stddev median
2035+# ============ === ======= ======= ======= ======= ======= ======= =======
2036+# Count 100 1
2037+# Exec time 100 215ms 215ms 215ms 215ms 215ms 0 215ms
2038+# Lock time 99 162us 162us 162us 162us 162us 0 162us
2039+# Rows sent 100 10 10 10 10 10 0 10
2040+# Rows examine 100 1.96k 1.96k 1.96k 1.96k 1.96k 0 1.96k
2041+# Query size 100 82 82 82 82 82 0 82
2042+# String:
2043+# Databases issue_1196
2044+# Hosts localhost
2045+# Users root
2046+# Query_time distribution
2047+# 1us
2048+# 10us
2049+# 100us
2050+# 1ms
2051+# 10ms
2052+# 100ms ################################################################
2053+# 1s
2054+# 10s+
2055+# Tables
2056+# SHOW TABLE STATUS FROM `issue_1196` LIKE 't'\G
2057+# SHOW CREATE TABLE `issue_1196`.`t`\G
2058+# EXPLAIN /*!50100 PARTITIONS*/
2059+select t.a, count(*) from t join t t2 using(a) group by 1 order by 2 desc limit 10\G
2060+# *************************** 1. row ***************************
2061+# id: 1
2062+# select_type: SIMPLE
2063+# table: t
2064+# partitions: NULL
2065+# type: ALL
2066+# possible_keys: NULL
2067+# key: NULL
2068+# key_len: NULL
2069+# ref: NULL
2070+# rows: 14
2071+# Extra: Using temporary; Using filesort
2072+# *************************** 2. row ***************************
2073+# id: 1
2074+# select_type: SIMPLE
2075+# table: t2
2076+# partitions: NULL
2077+# type: ALL
2078+# possible_keys: NULL
2079+# key: NULL
2080+# key_len: NULL
2081+# ref: NULL
2082+# rows: 14
2083+# Extra: Using where; Using join buffer (Block Nested Loop)
2084
2085=== modified file 't/pt-table-checksum/basics.t'
2086--- t/pt-table-checksum/basics.t 2012-11-21 16:58:40 +0000
2087+++ t/pt-table-checksum/basics.t 2012-12-20 23:20:29 +0000
2088@@ -68,9 +68,7 @@
2089 ok(
2090 no_diff(
2091 sub { pt_table_checksum::main(@args) },
2092- $sandbox_version gt "5.1 " ? "$sample/default-results-5.5.txt"
2093- : $sandbox_version gt "5.0 " ? "$sample/default-results-5.1.txt"
2094- : "$sample/default-results-5.0.txt",
2095+ "$sample/default-results-$sandbox_version.txt",
2096 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'',
2097 ),
2098 "Default checksum"
2099@@ -93,29 +91,28 @@
2100 ok(
2101 no_diff(
2102 sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) },
2103- $sandbox_version gt "5.1" ? "$sample/static-chunk-size-results-5.5.txt"
2104- : $sandbox_version gt "5.0" ? "$sample/static-chunk-size-results-5.1.txt"
2105- : "$sample/static-chunk-size-results-5.0.txt",
2106+ "$sample/static-chunk-size-results-$sandbox_version.txt",
2107 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'',
2108 ),
2109 "Static chunk size (--chunk-time 0)"
2110 );
2111
2112+my $n_checksums = $sandbox_version eq "5.6" ? 89
2113+ : $sandbox_version eq "5.5" ? 90
2114+ : $sandbox_version eq "5.1" ? 89
2115+ : 85;
2116+
2117 $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
2118 is(
2119 $row->[0],
2120- ( $sandbox_version gt "5.1" ? 90
2121- : $sandbox_version gt "5.0" ? 89
2122- : 85),
2123+ $n_checksums,
2124 'Expected checksums on master'
2125 );
2126
2127 $row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums");
2128 is(
2129 $row->[0],
2130- ( $sandbox_version gt "5.1" ? 90
2131- : $sandbox_version gt "5.0" ? 89
2132- : 85),
2133+ $n_checksums,
2134 'Expected checksums on slave'
2135 );
2136
2137
2138=== modified file 't/pt-table-checksum/error_handling.t'
2139--- t/pt-table-checksum/error_handling.t 2012-11-21 16:58:40 +0000
2140+++ t/pt-table-checksum/error_handling.t 2012-12-20 23:20:29 +0000
2141@@ -178,8 +178,8 @@
2142 # Use the --replicate table created by the previous ^ tests.
2143
2144 # Create a user that can't create the --replicate table.
2145-diag(`/tmp/12345/use -uroot -pmsandbox < $trunk/t/lib/samples/ro-checksum-user.sql`);
2146-diag(`/tmp/12345/use -uroot -pmsandbox -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`);
2147+diag(`/tmp/12345/use -uroot < $trunk/t/lib/samples/ro-checksum-user.sql`);
2148+diag(`/tmp/12345/use -uroot -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`);
2149
2150 # Remove the --replicate table from slave1 and slave2,
2151 # so it's only on the master...
2152@@ -199,7 +199,7 @@
2153 "CREATE DATABASE error and db is missing on slaves (bug 1039569)"
2154 );
2155
2156-diag(`/tmp/12345/use -uroot -pmsandbox -e "DROP USER ro_checksum_user\@'%'"`);
2157+diag(`/tmp/12345/use -uroot -e "DROP USER ro_checksum_user\@'%'"`);
2158
2159 # #############################################################################
2160 # Done.
2161
2162=== modified file 't/pt-table-checksum/run_time.t'
2163--- t/pt-table-checksum/run_time.t 2012-11-21 16:58:40 +0000
2164+++ t/pt-table-checksum/run_time.t 2012-12-20 23:20:29 +0000
2165@@ -44,7 +44,7 @@
2166 my $t = time - $t0;
2167
2168 ok(
2169- $t >= 1.5 && $t <= 2.5,
2170+ $t >= 1.1 && $t <= 2.5,
2171 "Ran in roughly --run-time 1 second"
2172 ) or diag("Actual run time: $t");
2173
2174
2175=== added file 't/pt-table-checksum/samples/default-results-5.6.txt'
2176--- t/pt-table-checksum/samples/default-results-5.6.txt 1970-01-01 00:00:00 +0000
2177+++ t/pt-table-checksum/samples/default-results-5.6.txt 2012-12-20 23:20:29 +0000
2178@@ -0,0 +1,41 @@
2179+ERRORS DIFFS ROWS SKIPPED TABLE
2180+0 0 0 0 mysql.columns_priv
2181+0 0 2 0 mysql.db
2182+0 0 0 0 mysql.event
2183+0 0 0 0 mysql.func
2184+0 0 39 0 mysql.help_category
2185+0 0 461 0 mysql.help_keyword
2186+0 0 1045 0 mysql.help_relation
2187+0 0 324 0 mysql.help_topic
2188+0 0 0 0 mysql.ndb_binlog_index
2189+0 0 0 0 mysql.plugin
2190+0 0 0 0 mysql.proc
2191+0 0 0 0 mysql.procs_priv
2192+0 0 2 0 mysql.proxies_priv
2193+0 0 0 0 mysql.servers
2194+0 0 0 0 mysql.tables_priv
2195+0 0 0 0 mysql.time_zone
2196+0 0 0 0 mysql.time_zone_leap_second
2197+0 0 0 0 mysql.time_zone_name
2198+0 0 0 0 mysql.time_zone_transition
2199+0 0 0 0 mysql.time_zone_transition_type
2200+0 0 2 0 mysql.user
2201+0 0 42 0 percona_test.checksums
2202+0 0 1 0 percona_test.load_data
2203+0 0 1 0 percona_test.sentinel
2204+0 0 200 0 sakila.actor
2205+0 0 603 0 sakila.address
2206+0 0 16 0 sakila.category
2207+0 0 600 0 sakila.city
2208+0 0 109 0 sakila.country
2209+0 0 599 0 sakila.customer
2210+0 0 1000 0 sakila.film
2211+0 0 5462 0 sakila.film_actor
2212+0 0 1000 0 sakila.film_category
2213+0 0 1000 0 sakila.film_text
2214+0 0 4581 0 sakila.inventory
2215+0 0 6 0 sakila.language
2216+0 0 16049 0 sakila.payment
2217+0 0 16044 0 sakila.rental
2218+0 0 2 0 sakila.staff
2219+0 0 2 0 sakila.store
2220
2221=== added file 't/pt-table-checksum/samples/repl-table-myisam.sql'
2222--- t/pt-table-checksum/samples/repl-table-myisam.sql 1970-01-01 00:00:00 +0000
2223+++ t/pt-table-checksum/samples/repl-table-myisam.sql 2012-12-20 23:20:29 +0000
2224@@ -0,0 +1,19 @@
2225+DROP DATABASE IF EXISTS percona;
2226+CREATE DATABASE percona;
2227+USE percona;
2228+CREATE TABLE checksums (
2229+ db char(64) NOT NULL,
2230+ tbl char(64) NOT NULL,
2231+ chunk int NOT NULL,
2232+ chunk_time float NULL,
2233+ chunk_index varchar(200) NULL,
2234+ lower_boundary text NULL,
2235+ upper_boundary text NULL,
2236+ this_crc char(40) NOT NULL,
2237+ this_cnt int NOT NULL,
2238+ master_crc char(40) NULL,
2239+ master_cnt int NULL,
2240+ ts timestamp NOT NULL,
2241+ PRIMARY KEY (db, tbl, chunk),
2242+ INDEX ts_db_tbl (ts, db, tbl)
2243+) ENGINE=MyISAM;
2244
2245=== added file 't/pt-table-checksum/samples/static-chunk-size-results-5.6.txt'
2246--- t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 1970-01-01 00:00:00 +0000
2247+++ t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 2012-12-20 23:20:29 +0000
2248@@ -0,0 +1,41 @@
2249+ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
2250+0 0 0 1 0 mysql.columns_priv
2251+0 0 2 1 0 mysql.db
2252+0 0 0 1 0 mysql.event
2253+0 0 0 1 0 mysql.func
2254+0 0 39 1 0 mysql.help_category
2255+0 0 461 1 0 mysql.help_keyword
2256+0 0 1045 1 0 mysql.help_relation
2257+0 0 324 1 0 mysql.help_topic
2258+0 0 0 1 0 mysql.ndb_binlog_index
2259+0 0 0 1 0 mysql.plugin
2260+0 0 0 1 0 mysql.proc
2261+0 0 0 1 0 mysql.procs_priv
2262+0 0 2 1 0 mysql.proxies_priv
2263+0 0 0 1 0 mysql.servers
2264+0 0 0 1 0 mysql.tables_priv
2265+0 0 0 1 0 mysql.time_zone
2266+0 0 0 1 0 mysql.time_zone_leap_second
2267+0 0 0 1 0 mysql.time_zone_name
2268+0 0 0 1 0 mysql.time_zone_transition
2269+0 0 0 1 0 mysql.time_zone_transition_type
2270+0 0 2 1 0 mysql.user
2271+0 0 42 1 0 percona_test.checksums
2272+0 0 1 1 0 percona_test.load_data
2273+0 0 1 1 0 percona_test.sentinel
2274+0 0 200 1 0 sakila.actor
2275+0 0 603 1 0 sakila.address
2276+0 0 16 1 0 sakila.category
2277+0 0 600 1 0 sakila.city
2278+0 0 109 1 0 sakila.country
2279+0 0 599 1 0 sakila.customer
2280+0 0 1000 1 0 sakila.film
2281+0 0 5462 8 0 sakila.film_actor
2282+0 0 1000 1 0 sakila.film_category
2283+0 0 1000 1 0 sakila.film_text
2284+0 0 4581 7 0 sakila.inventory
2285+0 0 6 1 0 sakila.language
2286+0 0 16049 19 0 sakila.payment
2287+0 0 16044 19 0 sakila.rental
2288+0 0 2 1 0 sakila.staff
2289+0 0 2 1 0 sakila.store
2290
2291=== modified file 't/pt-table-checksum/skip_innodb.t'
2292--- t/pt-table-checksum/skip_innodb.t 2012-11-21 16:58:40 +0000
2293+++ t/pt-table-checksum/skip_innodb.t 2012-12-20 23:20:29 +0000
2294@@ -15,11 +15,12 @@
2295 use Sandbox;
2296 require "$trunk/bin/pt-table-checksum";
2297
2298-diag("Stopping/reconfiguring/restarting sandboxes 12348 and 12349");
2299-diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
2300+if ( $sandbox_version eq '5.6' ) {
2301+ plan skip_all => 'http://bugs.mysql.com/67798';
2302+}
2303+
2304+diag(`$trunk/sandbox/stop-sandbox 12348 12349 >/dev/null`);
2305 diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`);
2306-
2307-diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);
2308 diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox slave 12349 12348 >/dev/null`);
2309
2310 my $dp = new DSNParser(opts=>$dsn_opts);
2311@@ -33,9 +34,6 @@
2312 elsif ( !$slave_dbh ) {
2313 plan skip_all => 'Cannot connect to sandbox slave 12349';
2314 }
2315-else {
2316- plan tests => 3;
2317-}
2318
2319 # The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
2320 # so we need to specify --lock-wait-timeout=3 else the tool will die.
2321@@ -45,6 +43,26 @@
2322 my $output;
2323 my $retval;
2324
2325+if ( $sandbox_version ge '5.6' ) {
2326+ # Before MySQL 5.6, even with the InnoDB engine off, creating an InnoDB
2327+ # table would simply result in:
2328+ #
2329+ # mysql> create table t (i int) engine=innodb;
2330+ # Query OK, 0 rows affected, 2 warnings (0.01 sec)
2331+ #
2332+ # mysql> show warnings;
2333+ # +---------+------+-------------------------------------------+
2334+ # | Level | Code | Message |
2335+ # +---------+------+-------------------------------------------+
2336+ # | Warning | 1286 | Unknown table engine 'innodb' |
2337+ # | Warning | 1266 | Using storage engine MyISAM for table 't' |
2338+ # +---------+------+-------------------------------------------+
2339+ #
2340+ # But 5.6 throws an error. So we have to create the table manually.
2341+ $sb->load_file('master1', "t/pt-table-checksum/samples/repl-table-myisam.sql");
2342+ $sb->wait_for_slaves(master => 'master1', slave => 'master2');
2343+}
2344+
2345 $output = output(
2346 sub { $retval = pt_table_checksum::main(@args) },
2347 stderr => 1,
2348@@ -60,13 +78,12 @@
2349 $retval,
2350 0,
2351 "0 exit status (bug 996110)"
2352-);
2353+) or diag($output);
2354
2355 # #############################################################################
2356 # Done.
2357 # #############################################################################
2358-diag('Shutting down sandboxes');
2359-diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);
2360-diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
2361+$sb->wipe_clean($master_dbh);
2362+diag(`$trunk/sandbox/stop-sandbox 12349 12348 >/dev/null`);
2363 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
2364-exit;
2365+done_testing;
2366
2367=== modified file 't/pt-table-sync/basics.t'
2368--- t/pt-table-sync/basics.t 2012-06-07 14:25:44 +0000
2369+++ t/pt-table-sync/basics.t 2012-12-20 23:20:29 +0000
2370@@ -188,7 +188,7 @@
2371
2372 like(
2373 $output,
2374- qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 04:34:33'\)/,
2375+ qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 11:34:33'\)/,
2376 "--replicate with char index col (bug 911996)"
2377 );
2378
2379
2380=== modified file 't/pt-upgrade/warnings.t'
2381--- t/pt-upgrade/warnings.t 2012-10-17 22:19:44 +0000
2382+++ t/pt-upgrade/warnings.t 2012-12-20 23:20:29 +0000
2383@@ -15,38 +15,36 @@
2384 use Sandbox;
2385 require "$trunk/bin/pt-upgrade";
2386
2387-# This runs immediately if the server is already running, else it starts it.
2388-diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);
2389+diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`);
2390+diag(`QUERY_CACHE_SIZE=1048576 $trunk/sandbox/start-sandbox master 12349 >/dev/null`);
2391
2392 my $dp = new DSNParser(opts=>$dsn_opts);
2393 my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
2394 my $dbh1 = $sb->get_dbh_for('master');
2395-my $dbh2 = $sb->get_dbh_for('master1');
2396+my $dbh2 = $sb->get_dbh_for('master2');
2397
2398 if ( !$dbh1 ) {
2399- diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);
2400 plan skip_all => 'Cannot connect to sandbox master';
2401 }
2402 elsif ( !$dbh2 ) {
2403- diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);
2404+ diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`);
2405 plan skip_all => 'Cannot connect to second sandbox master';
2406 }
2407
2408 $sb->load_file('master', 't/pt-upgrade/samples/001/tables.sql');
2409-$sb->load_file('master1', 't/pt-upgrade/samples/001/tables.sql');
2410+$sb->load_file('master2', 't/pt-upgrade/samples/001/tables.sql');
2411
2412 my $output;
2413-my $cmd = "$trunk/bin/pt-upgrade h=127.1,P=12345,u=msandbox,p=msandbox,L=1 P=12348 --compare results,warnings --zero-query-times --compare-results-method rows --limit 10";
2414+my $cmd = "$trunk/bin/pt-upgrade h=127.1,P=12345,u=msandbox,p=msandbox,L=1 P=12349 --compare results,warnings --zero-query-times --compare-results-method rows --limit 10";
2415
2416 # This test really deals with,
2417 # http://code.google.com/p/maatkit/issues/detail?id=754
2418 # http://bugs.mysql.com/bug.php?id=49634
2419
2420-$dbh2->do('set global query_cache_size=1000000');
2421-
2422 my $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1];
2423-ok(
2424- $qc > 999000,
2425+is(
2426+ $qc,
2427+ 1048576,
2428 'Query size'
2429 );
2430
2431@@ -62,7 +60,7 @@
2432 $output = `$cmd $trunk/t/pt-upgrade/samples/001/one-error.log`;
2433 like(
2434 $output,
2435- qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
2436+ qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
2437 '--clear-warnings',
2438 );
2439
2440@@ -78,22 +76,15 @@
2441 $output = `$cmd --no-clear-warnings $trunk/t/pt-upgrade/samples/001/one-error.log`;
2442 like(
2443 $output,
2444- qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
2445+ qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
2446 '--no-clear-warnings'
2447 );
2448
2449-$dbh2->do('set global query_cache_size=0');
2450-$qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1];
2451-ok(
2452- $qc == 0,
2453- 'Query size'
2454-);
2455-
2456 # #############################################################################
2457 # Done.
2458 # #############################################################################
2459+diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);
2460 $sb->wipe_clean($dbh1);
2461-diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);
2462 ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
2463 done_testing;
2464 exit;

Subscribers

People subscribed via source and target branches