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

Proposed by Daniel Nichter
Status: Merged
Merged at revision: 504
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes
Merge into: lp:percona-toolkit/2.2
Diff against target: 3530 lines (+2141/-278)
53 files modified
bin/pt-deadlock-logger (+14/-6)
bin/pt-duplicate-key-checker (+36/-18)
bin/pt-fk-error-logger (+5/-1)
bin/pt-heartbeat (+130/-13)
bin/pt-index-usage (+36/-18)
bin/pt-log-player (+5/-0)
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/jenkins-test (+9/-1)
sandbox/start-sandbox (+20/-1)
sandbox/test-env (+8/-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/bash/collect_system_info.sh (+2/-2)
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-config-diff/samples/case1.cnf (+2/-0)
t/pt-config-diff/samples/case2.cnf (+2/-0)
t/pt-deadlock-logger/bugs.t (+54/-1)
t/pt-deadlock-logger/samples/bug_1082104.txt (+53/-0)
t/pt-find/pt-find.t (+77/-3)
t/pt-heartbeat/bugs.t (+115/-0)
t/pt-heartbeat/pxc.t (+388/-0)
t/pt-ioprofile/pt-ioprofile.t (+15/-18)
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/issue_388.t (+1/-0)
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
Daniel Nichter Approve
Brian Fraser Pending
Review via email: mp+139357@code.launchpad.net
To post a comment you must log in.
504. By Daniel Nichter

Add /usr/local/bin to PATH in jenkins-test.

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.

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.

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.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Post-merge approval.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-deadlock-logger'
--- bin/pt-deadlock-logger 2012-12-03 03:48:11 +0000
+++ bin/pt-deadlock-logger 2012-12-20 23:20:32 +0000
@@ -3757,8 +3757,9 @@
3757my $t = qr/((?:\d+ \d+)|(?:[A-Fa-f0-9]+))/; # Transaction ID3757my $t = qr/((?:\d+ \d+)|(?:[A-Fa-f0-9]+))/; # Transaction ID
3758my $i = qr/((?:\d{1,3}\.){3}\d+)/; # IP address3758my $i = qr/((?:\d{1,3}\.){3}\d+)/; # IP address
3759my $n = qr/([^`\s]+)/; # MySQL object name3759my $n = qr/([^`\s]+)/; # MySQL object name
3760my $w = qr/(\w+)/; # Words3760my $u = qr/(\S+)/; # Username. This is somewhat wrong, but
3761my $s = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp3761 # usernames with spaces are rare enough.
3762my $s = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)(?: [A-Fa-f0-9]+)?/; # InnoDB timestamp
37623763
3763# A thread's proc_info can be at least 98 different things I've found in the3764# A thread's proc_info can be at least 98 different things I've found in the
3764# source. Fortunately, most of them begin with a gerunded verb. These are3765# source. Fortunately, most of them begin with a gerunded verb. These are
@@ -4082,7 +4083,7 @@
4082 # the most useful marker for where I have to start guessing.4083 # the most useful marker for where I have to start guessing.
4083 ( $hostname, $ip ) = $thread_line =~ m/query id \d+(?: ([A-Za-z]\S+))? $i/m;4084 ( $hostname, $ip ) = $thread_line =~ m/query id \d+(?: ([A-Za-z]\S+))? $i/m;
4084 if ( defined $ip ) {4085 if ( defined $ip ) {
4085 ($user, $query_status) = $thread_line =~ m/$ip $w(?: (.*))?$/;4086 ($user, $query_status) = $thread_line =~ m/$ip $u(?: (.*))?$/;
4086 }4087 }
4087 else {4088 else {
4088 # OK, there wasn't an IP address.4089 # OK, there wasn't an IP address.
@@ -4094,7 +4095,7 @@
4094 # query_status.4095 # query_status.
4095 # It's basically impossible to know which is which.4096 # It's basically impossible to know which is which.
4096 ( $hostname, $user, $query_status ) = $thread_line4097 ( $hostname, $user, $query_status ) = $thread_line
4097 =~ m/query id \d+(?: ([A-Za-z]\S+))?(?: $w(?: (.*))?)?$/m;4098 =~ m/query id \d+(?: ([A-Za-z]\S+))?(?: $u(?: (.*))?)?$/m;
4098 }4099 }
4099 else {4100 else {
4100 $user = 'system user';4101 $user = 'system user';
@@ -4139,8 +4140,11 @@
41394140
4140 # Extract some miscellaneous data from the deadlock.4141 # Extract some miscellaneous data from the deadlock.
4141 my ( $ts ) = $dl_text =~ m/^$s$/m;4142 my ( $ts ) = $dl_text =~ m/^$s$/m;
4142 my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/;4143 my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/;
4143 $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year + 2000, $mon, $day, $hour, $min, $sec);4144 if ( length($year) == 2 ) {
4145 $year += 2000;
4146 }
4147 $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $day, $hour, $min, $sec);
4144 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;4148 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
4145 $victim ||= 0;4149 $victim ||= 0;
41464150
@@ -4387,6 +4391,10 @@
4387both wait-for locks and get more information. If the two waited-for locks are4391both wait-for locks and get more information. If the two waited-for locks are
4388not on the same table, more than two transactions were involved in the deadlock.4392not on the same table, more than two transactions were involved in the deadlock.
43894393
4394Finally, keep in mind that, because usernames with spaces are not quoted by
4395InnoDB, the tool will generally misreport the second word of these usernames
4396as the hostname.
4397
4390=head1 OPTIONS4398=head1 OPTIONS
43914399
4392This tool accepts additional command-line arguments. Refer to the4400This tool accepts additional command-line arguments. Refer to the
43934401
=== modified file 'bin/pt-duplicate-key-checker'
--- bin/pt-duplicate-key-checker 2012-12-03 03:48:11 +0000
+++ bin/pt-duplicate-key-checker 2012-12-20 23:20:32 +0000
@@ -3026,11 +3026,16 @@
30263026
3027 if ( !$self->{initialized} ) {3027 if ( !$self->{initialized} ) {
3028 $self->{initialized} = 1;3028 $self->{initialized} = 1;
3029 if ( $self->{resume}->{tbl}3029 if ( $self->{resume}->{tbl} ) {
3030 && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {3030 if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
3031 PTDEBUG && _d('Will resume after',3031 PTDEBUG && _d('Will resume after',
3032 join('.', @{$self->{resume}}{qw(db tbl)}));3032 join('.', @{$self->{resume}}{qw(db tbl)}));
3033 $self->{resume}->{after} = 1;3033 $self->{resume}->{after}->{tbl} = 1;
3034 }
3035 if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
3036 PTDEBUG && _d('Will resume after', $self->{resume}->{db});
3037 $self->{resume}->{after}->{db} = 1;
3038 }
3034 }3039 }
3035 }3040 }
30363041
@@ -3128,16 +3133,17 @@
3128 if ( !defined $self->{dbs} ) {3133 if ( !defined $self->{dbs} ) {
3129 my $sql = 'SHOW DATABASES';3134 my $sql = 'SHOW DATABASES';
3130 PTDEBUG && _d($sql);3135 PTDEBUG && _d($sql);
3131 my @dbs = grep { $self->database_is_allowed($_) }3136 my @dbs = grep {
3132 @{$dbh->selectcol_arrayref($sql)};3137 $self->_resume_from_database($_)
3138 &&
3139 $self->database_is_allowed($_)
3140 } @{$dbh->selectcol_arrayref($sql)};
3133 PTDEBUG && _d('Found', scalar @dbs, 'databases');3141 PTDEBUG && _d('Found', scalar @dbs, 'databases');
3134 $self->{dbs} = \@dbs;3142 $self->{dbs} = \@dbs;
3135 }3143 }
31363144
3137 if ( !$self->{db} ) {3145 if ( !$self->{db} ) {
3138 do {3146 $self->{db} = shift @{$self->{dbs}};
3139 $self->{db} = shift @{$self->{dbs}};
3140 } until $self->_resume_from_database($self->{db});
3141 PTDEBUG && _d('Next database:', $self->{db});3147 PTDEBUG && _d('Next database:', $self->{db});
3142 return unless $self->{db};3148 return unless $self->{db};
3143 }3149 }
@@ -3239,9 +3245,15 @@
32393245
3240 my $filter = $self->{filters};3246 my $filter = $self->{filters};
32413247
3242 if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {3248 return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
3243 return 0;3249 general_log
3244 }3250 |slow_log
3251 |innodb_index_stats
3252 |innodb_table_stats
3253 |slave_master_info
3254 |slave_relay_log_info
3255 |slave_worker_info
3256 )$/x;
32453257
3246 if ( $filter->{'ignore-tables'}->{$tbl}3258 if ( $filter->{'ignore-tables'}->{$tbl}
3247 && ($filter->{'ignore-tables'}->{$tbl} eq '*'3259 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
@@ -3310,11 +3322,17 @@
3310 my ($self, $db) = @_;3322 my ($self, $db) = @_;
33113323
3312 return 1 unless $self->{resume}->{db};3324 return 1 unless $self->{resume}->{db};
3313
3314 if ( $db eq $self->{resume}->{db} ) {3325 if ( $db eq $self->{resume}->{db} ) {
3315 PTDEBUG && _d('At resume db', $db);3326 if ( !$self->{resume}->{after}->{db} ) {
3316 delete $self->{resume}->{db};3327 PTDEBUG && _d('Resuming from db', $db);
3317 return 1;3328 delete $self->{resume}->{db};
3329 return 1;
3330 }
3331 else {
3332 PTDEBUG && _d('Resuming after db', $db);
3333 delete $self->{resume}->{db};
3334 delete $self->{resume}->{tbl};
3335 }
3318 }3336 }
33193337
3320 return 0;3338 return 0;
@@ -3326,7 +3344,7 @@
3326 return 1 unless $self->{resume}->{tbl};3344 return 1 unless $self->{resume}->{tbl};
33273345
3328 if ( $tbl eq $self->{resume}->{tbl} ) {3346 if ( $tbl eq $self->{resume}->{tbl} ) {
3329 if ( !$self->{resume}->{after} ) {3347 if ( !$self->{resume}->{after}->{tbl} ) {
3330 PTDEBUG && _d('Resuming from table', $tbl);3348 PTDEBUG && _d('Resuming from table', $tbl);
3331 delete $self->{resume}->{tbl};3349 delete $self->{resume}->{tbl};
3332 return 1;3350 return 1;
33333351
=== modified file 'bin/pt-fk-error-logger'
--- bin/pt-fk-error-logger 2012-12-03 03:48:11 +0000
+++ bin/pt-fk-error-logger 2012-12-20 23:20:32 +0000
@@ -1942,6 +1942,9 @@
1942 . (defined $f ? '%09.6f' : '%02d'),1942 . (defined $f ? '%09.6f' : '%02d'),
1943 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);1943 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
1944 }1944 }
1945 elsif ( $val =~ m/^$proper_ts$/ ) {
1946 return $val;
1947 }
1945 return $val;1948 return $val;
1946}1949}
19471950
@@ -3609,7 +3612,8 @@
3609 # Quick check if text even has a foreign key error.3612 # Quick check if text even has a foreign key error.
3610 return unless $text =~ m/LATEST FOREIGN KEY ERROR/;3613 return unless $text =~ m/LATEST FOREIGN KEY ERROR/;
36113614
3612 my $idb_ts = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp3615 # InnoDB timestamp
3616 my $idb_ts = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)/;
36133617
3614 my ($ts, $fke) = $text =~ m/LATEST FOREIGN KEY ERROR.+?$idb_ts\s*(.+?)---/ms;3618 my ($ts, $fke) = $text =~ m/LATEST FOREIGN KEY ERROR.+?$idb_ts\s*(.+?)---/ms;
3615 chomp $fke if $fke;3619 chomp $fke if $fke;
36163620
=== modified file 'bin/pt-heartbeat'
--- bin/pt-heartbeat 2012-12-03 03:48:11 +0000
+++ bin/pt-heartbeat 2012-12-20 23:20:32 +0000
@@ -20,6 +20,7 @@
20 Daemon20 Daemon
21 Quoter21 Quoter
22 TableParser22 TableParser
23 Retry
23 Transformers24 Transformers
24 VersionCheck25 VersionCheck
25 HTTPMicro26 HTTPMicro
@@ -2921,6 +2922,84 @@
2921# ###########################################################################2922# ###########################################################################
29222923
2923# ###########################################################################2924# ###########################################################################
2925# Retry package
2926# This package is a copy without comments from the original. The original
2927# with comments and its test file can be found in the Bazaar repository at,
2928# lib/Retry.pm
2929# t/lib/Retry.t
2930# See https://launchpad.net/percona-toolkit for more information.
2931# ###########################################################################
2932{
2933package Retry;
2934
2935use strict;
2936use warnings FATAL => 'all';
2937use English qw(-no_match_vars);
2938use constant PTDEBUG => $ENV{PTDEBUG} || 0;
2939
2940sub new {
2941 my ( $class, %args ) = @_;
2942 my $self = {
2943 %args,
2944 };
2945 return bless $self, $class;
2946}
2947
2948sub retry {
2949 my ( $self, %args ) = @_;
2950 my @required_args = qw(try fail final_fail);
2951 foreach my $arg ( @required_args ) {
2952 die "I need a $arg argument" unless $args{$arg};
2953 };
2954 my ($try, $fail, $final_fail) = @args{@required_args};
2955 my $wait = $args{wait} || sub { sleep 1; };
2956 my $tries = $args{tries} || 3;
2957
2958 my $last_error;
2959 my $tryno = 0;
2960 TRY:
2961 while ( ++$tryno <= $tries ) {
2962 PTDEBUG && _d("Try", $tryno, "of", $tries);
2963 my $result;
2964 eval {
2965 $result = $try->(tryno=>$tryno);
2966 };
2967 if ( $EVAL_ERROR ) {
2968 PTDEBUG && _d("Try code failed:", $EVAL_ERROR);
2969 $last_error = $EVAL_ERROR;
2970
2971 if ( $tryno < $tries ) { # more retries
2972 my $retry = $fail->(tryno=>$tryno, error=>$last_error);
2973 last TRY unless $retry;
2974 PTDEBUG && _d("Calling wait code");
2975 $wait->(tryno=>$tryno);
2976 }
2977 }
2978 else {
2979 PTDEBUG && _d("Try code succeeded");
2980 return $result;
2981 }
2982 }
2983
2984 PTDEBUG && _d('Try code did not succeed');
2985 return $final_fail->(error=>$last_error);
2986}
2987
2988sub _d {
2989 my ($package, undef, $line) = caller 0;
2990 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
2991 map { defined $_ ? $_ : 'undef' }
2992 @_;
2993 print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
2994}
2995
29961;
2997}
2998# ###########################################################################
2999# End Retry package
3000# ###########################################################################
3001
3002# ###########################################################################
2924# Transformers package3003# Transformers package
2925# This package is a copy without comments from the original. The original3004# This package is a copy without comments from the original. The original
2926# with comments and its test file can be found in the Bazaar repository at,3005# with comments and its test file can be found in the Bazaar repository at,
@@ -4734,7 +4813,7 @@
4734 $dbh->do($sql);4813 $dbh->do($sql);
47354814
4736 $sql = ($o->get('replace') ? "REPLACE" : "INSERT")4815 $sql = ($o->get('replace') ? "REPLACE" : "INSERT")
4737 . qq/ INTO $db_tbl (ts, server_id) VALUES (NOW(), $server_id)/;4816 . qq/ INTO $db_tbl (ts, server_id) VALUES (UTC_TIMESTAMP(), $server_id)/;
4738 PTDEBUG && _d($sql);4817 PTDEBUG && _d($sql);
4739 # This may fail if the table already existed and already had this row.4818 # This may fail if the table already existed and already had this row.
4740 # We eval to ignore this possibility.4819 # We eval to ignore this possibility.
@@ -4831,7 +4910,7 @@
4831 PTDEBUG && _d('No heartbeat row in table');4910 PTDEBUG && _d('No heartbeat row in table');
4832 if ( $o->get('insert-heartbeat-row') ) {4911 if ( $o->get('insert-heartbeat-row') ) {
4833 my $sql = "INSERT INTO $db_tbl ($pk_col, ts) "4912 my $sql = "INSERT INTO $db_tbl ($pk_col, ts) "
4834 . "VALUES ('$pk_val', NOW())";4913 . "VALUES ('$pk_val', UTC_TIMESTAMP())";
4835 PTDEBUG && _d($sql);4914 PTDEBUG && _d($sql);
4836 $dbh->do($sql);4915 $dbh->do($sql);
4837 }4916 }
@@ -4920,18 +4999,44 @@
4920 }4999 }
4921 }5000 }
49225001
4923 $sth->execute(ts(time), @vals);5002 my $retry = Retry->new();
4924 PTDEBUG && _d($sth->{Statement});5003 $retry->retry(
4925 $sth->finish();5004 tries => 3,
49265005 wait => sub { sleep 0.25; return; },
5006 try => sub {
5007 my ($now) = $dbh->selectrow_array(q{SELECT UTC_TIMESTAMP()});
5008 $sth->execute($now, @vals);
5009 PTDEBUG && _d($sth->{Statement});
5010 $sth->finish();
5011 },
5012 fail => sub {
5013 my (%args) = @_;
5014 my $error = $args{error};
5015 if ( $error =~ m/Deadlock found/ ) {
5016 return 1; # try again
5017 }
5018 else {
5019 return 0;
5020 }
5021 },
5022 final_fail => sub {
5023 my (%args) = @_;
5024 die $args{error};
5025 }
5026 );
5027
4927 return;5028 return;
4928 };5029 };
4929 }5030 }
4930 else { # --monitor or --check5031 else { # --monitor or --check
4931 my $dbi_driver = lc $o->get('dbi-driver');5032 my $dbi_driver = lc $o->get('dbi-driver');
49325033
5034 # UNIX_TIMESTAMP(UTC_TIMESTAMP()) instead of UNIX_TIMESTAMP() alone,
5035 # so we make sure that we aren't being fooled by a timezone.
5036 # UNIX_TIMESTAMP(ts) replaces unix_timestamp($ts) -- MySQL is the
5037 # authority here, so let it calculate everything.
4933 $heartbeat_sql5038 $heartbeat_sql
4934 = "SELECT ts"5039 = "SELECT UNIX_TIMESTAMP(UTC_TIMESTAMP()), UNIX_TIMESTAMP(ts)"
4935 . ($dbi_driver eq 'mysql' ? '/*!50038, @@hostname AS host*/' : '')5040 . ($dbi_driver eq 'mysql' ? '/*!50038, @@hostname AS host*/' : '')
4936 . ($id ? "" : ", server_id")5041 . ($id ? "" : ", server_id")
4937 . " FROM $db_tbl "5042 . " FROM $db_tbl "
@@ -4945,13 +5050,12 @@
4945 my ($sth) = @_;5050 my ($sth) = @_;
4946 $sth->execute();5051 $sth->execute();
4947 PTDEBUG && _d($sth->{Statement});5052 PTDEBUG && _d($sth->{Statement});
4948 my ($ts, $hostname, $server_id) = $sth->fetchrow_array();5053 my ($now, $ts, $hostname, $server_id) = $sth->fetchrow_array();
4949 my $now = time;
4950 PTDEBUG && _d("Heartbeat from server", $server_id, "\n",5054 PTDEBUG && _d("Heartbeat from server", $server_id, "\n",
4951 " now:", ts($now), "\n",5055 " now:", $now, "\n",
4952 " ts:", $ts, "\n",5056 " ts:", $ts, "\n",
4953 "skew:", $skew);5057 "skew:", $skew);
4954 my $delay = $now - unix_timestamp($ts) - $skew;5058 my $delay = $now - $ts - $skew;
4955 PTDEBUG && _d('Delay', sprintf('%.6f', $delay), 'on', $hostname);5059 PTDEBUG && _d('Delay', sprintf('%.6f', $delay), 'on', $hostname);
49565060
4957 # Because we adjust for skew, if the ts are less than skew seconds5061 # Because we adjust for skew, if the ts are less than skew seconds
@@ -5387,6 +5491,19 @@
5387columns are optional. If any are present, their corresponding information5491columns are optional. If any are present, their corresponding information
5388will be saved.5492will be saved.
53895493
5494=head1 Percona XtraDB Cluster
5495
5496Although pt-heartbeat should work with all supported versions of Percona XtraDB
5497Cluster (PXC), we recommend using 5.5.28-23.7 and newer.
5498
5499If you are setting up heartbeat instances between cluster nodes, keep in mind
5500that, since the speed of the cluster is determined by its slowest node,
5501pt-heartbeat will not report how fast the cluster itself is, but only how
5502fast events are replicating from one node to another.
5503
5504You must specify L<"--master-server-id"> for L<"--monitor"> and L<"--check">
5505instances.
5506
5390=head1 OPTIONS5507=head1 OPTIONS
53915508
5392Specify at least one of L<"--stop">, L<"--update">, L<"--monitor">, or L<"--check">.5509Specify at least one of L<"--stop">, L<"--update">, L<"--monitor">, or L<"--check">.
@@ -5446,7 +5563,7 @@
5446The heartbeat table requires at least one row. If you manually create the5563The heartbeat table requires at least one row. If you manually create the
5447heartbeat table, then you must insert a row by doing:5564heartbeat table, then you must insert a row by doing:
54485565
5449 INSERT INTO heartbeat (ts, server_id) VALUES (NOW(), N);5566 INSERT INTO heartbeat (ts, server_id) VALUES (UTC_TIMESTAMP(), N);
54505567
5451where C<N> is the server's ID; do not use @@server_id because it will replicate5568where C<N> is the server's ID; do not use @@server_id because it will replicate
5452and slaves will insert their own server ID instead of the master's server ID.5569and slaves will insert their own server ID instead of the master's server ID.
@@ -5464,7 +5581,7 @@
5464of a multi-slave hierarchy like "master -> slave1 -> slave2".5581of a multi-slave hierarchy like "master -> slave1 -> slave2".
5465To manually insert the one required row into a legacy table:5582To manually insert the one required row into a legacy table:
54665583
5467 INSERT INTO heartbeat (id, ts) VALUES (1, NOW());5584 INSERT INTO heartbeat (id, ts) VALUES (1, UTC_TIMESTAMP());
54685585
5469The tool automatically detects if the heartbeat table is legacy.5586The tool automatically detects if the heartbeat table is legacy.
54705587
54715588
=== modified file 'bin/pt-index-usage'
--- bin/pt-index-usage 2012-12-03 03:48:11 +0000
+++ bin/pt-index-usage 2012-12-20 23:20:32 +0000
@@ -3844,11 +3844,16 @@
38443844
3845 if ( !$self->{initialized} ) {3845 if ( !$self->{initialized} ) {
3846 $self->{initialized} = 1;3846 $self->{initialized} = 1;
3847 if ( $self->{resume}->{tbl}3847 if ( $self->{resume}->{tbl} ) {
3848 && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {3848 if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
3849 PTDEBUG && _d('Will resume after',3849 PTDEBUG && _d('Will resume after',
3850 join('.', @{$self->{resume}}{qw(db tbl)}));3850 join('.', @{$self->{resume}}{qw(db tbl)}));
3851 $self->{resume}->{after} = 1;3851 $self->{resume}->{after}->{tbl} = 1;
3852 }
3853 if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
3854 PTDEBUG && _d('Will resume after', $self->{resume}->{db});
3855 $self->{resume}->{after}->{db} = 1;
3856 }
3852 }3857 }
3853 }3858 }
38543859
@@ -3946,16 +3951,17 @@
3946 if ( !defined $self->{dbs} ) {3951 if ( !defined $self->{dbs} ) {
3947 my $sql = 'SHOW DATABASES';3952 my $sql = 'SHOW DATABASES';
3948 PTDEBUG && _d($sql);3953 PTDEBUG && _d($sql);
3949 my @dbs = grep { $self->database_is_allowed($_) }3954 my @dbs = grep {
3950 @{$dbh->selectcol_arrayref($sql)};3955 $self->_resume_from_database($_)
3956 &&
3957 $self->database_is_allowed($_)
3958 } @{$dbh->selectcol_arrayref($sql)};
3951 PTDEBUG && _d('Found', scalar @dbs, 'databases');3959 PTDEBUG && _d('Found', scalar @dbs, 'databases');
3952 $self->{dbs} = \@dbs;3960 $self->{dbs} = \@dbs;
3953 }3961 }
39543962
3955 if ( !$self->{db} ) {3963 if ( !$self->{db} ) {
3956 do {3964 $self->{db} = shift @{$self->{dbs}};
3957 $self->{db} = shift @{$self->{dbs}};
3958 } until $self->_resume_from_database($self->{db});
3959 PTDEBUG && _d('Next database:', $self->{db});3965 PTDEBUG && _d('Next database:', $self->{db});
3960 return unless $self->{db};3966 return unless $self->{db};
3961 }3967 }
@@ -4057,9 +4063,15 @@
40574063
4058 my $filter = $self->{filters};4064 my $filter = $self->{filters};
40594065
4060 if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {4066 return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
4061 return 0;4067 general_log
4062 }4068 |slow_log
4069 |innodb_index_stats
4070 |innodb_table_stats
4071 |slave_master_info
4072 |slave_relay_log_info
4073 |slave_worker_info
4074 )$/x;
40634075
4064 if ( $filter->{'ignore-tables'}->{$tbl}4076 if ( $filter->{'ignore-tables'}->{$tbl}
4065 && ($filter->{'ignore-tables'}->{$tbl} eq '*'4077 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
@@ -4128,11 +4140,17 @@
4128 my ($self, $db) = @_;4140 my ($self, $db) = @_;
41294141
4130 return 1 unless $self->{resume}->{db};4142 return 1 unless $self->{resume}->{db};
4131
4132 if ( $db eq $self->{resume}->{db} ) {4143 if ( $db eq $self->{resume}->{db} ) {
4133 PTDEBUG && _d('At resume db', $db);4144 if ( !$self->{resume}->{after}->{db} ) {
4134 delete $self->{resume}->{db};4145 PTDEBUG && _d('Resuming from db', $db);
4135 return 1;4146 delete $self->{resume}->{db};
4147 return 1;
4148 }
4149 else {
4150 PTDEBUG && _d('Resuming after db', $db);
4151 delete $self->{resume}->{db};
4152 delete $self->{resume}->{tbl};
4153 }
4136 }4154 }
41374155
4138 return 0;4156 return 0;
@@ -4144,7 +4162,7 @@
4144 return 1 unless $self->{resume}->{tbl};4162 return 1 unless $self->{resume}->{tbl};
41454163
4146 if ( $tbl eq $self->{resume}->{tbl} ) {4164 if ( $tbl eq $self->{resume}->{tbl} ) {
4147 if ( !$self->{resume}->{after} ) {4165 if ( !$self->{resume}->{after}->{tbl} ) {
4148 PTDEBUG && _d('Resuming from table', $tbl);4166 PTDEBUG && _d('Resuming from table', $tbl);
4149 delete $self->{resume}->{tbl};4167 delete $self->{resume}->{tbl};
4150 return 1;4168 return 1;
41514169
=== modified file 'bin/pt-log-player'
--- bin/pt-log-player 2012-12-03 03:48:11 +0000
+++ bin/pt-log-player 2012-12-20 23:20:32 +0000
@@ -3100,6 +3100,11 @@
3100At the time of this release there is a bug which causes pt-log-player to3100At the time of this release there is a bug which causes pt-log-player to
3101exceed max open files during L<"--split">.3101exceed max open files during L<"--split">.
31023102
3103As of version 2.1.8, this tool no longer works with auto values on zero
3104because it sets a SQL mode with C<NO_AUTO_VALUE_ON_ZERO>. Therefore,
3105playing INSERT or UPDATE statements that use zero instead of C<NULL>
3106will not work.
3107
3103The authoritative source for updated information is always the online issue3108The authoritative source for updated information is always the online issue
3104tracking system. Issues that affect this tool will be marked as such. You can3109tracking system. Issues that affect this tool will be marked as such. You can
3105see a list of such issues at the following URL:3110see a list of such issues at the following URL:
31063111
=== modified file 'bin/pt-mysql-summary'
--- bin/pt-mysql-summary 2012-12-06 00:10:22 +0000
+++ bin/pt-mysql-summary 2012-12-20 23:20:32 +0000
@@ -2332,8 +2332,10 @@
23322332
2333TOOL="pt-mysql-summary"2333TOOL="pt-mysql-summary"
23342334
2335CMD_MYSQL="$(_which mysql)"2335# These vars are declared earlier in the collect_mysql_info package,
2336CMD_MYSQLDUMP="$( _which mysqldump )"2336# but if they're still undefined here, try to find them in PATH.
2337[ "$CMD_MYSQL" ] || CMD_MYSQL="$(_which mysql)"
2338[ "$CMD_MYSQLDUMP" ] || CMD_MYSQLDUMP="$( _which mysqldump )"
23372339
2338check_mysql () {2340check_mysql () {
2339 # Check that mysql and mysqldump are in PATH. If not, we're2341 # Check that mysql and mysqldump are in PATH. If not, we're
23402342
=== modified file 'bin/pt-table-checksum'
--- bin/pt-table-checksum 2012-12-11 14:48:44 +0000
+++ bin/pt-table-checksum 2012-12-20 23:20:32 +0000
@@ -6986,9 +6986,15 @@
69866986
6987 my $filter = $self->{filters};6987 my $filter = $self->{filters};
69886988
6989 if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {6989 return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
6990 return 0;6990 general_log
6991 }6991 |slow_log
6992 |innodb_index_stats
6993 |innodb_table_stats
6994 |slave_master_info
6995 |slave_relay_log_info
6996 |slave_worker_info
6997 )$/x;
69926998
6993 if ( $filter->{'ignore-tables'}->{$tbl}6999 if ( $filter->{'ignore-tables'}->{$tbl}
6994 && ($filter->{'ignore-tables'}->{$tbl} eq '*'7000 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
@@ -10123,9 +10129,9 @@
10123 }10129 }
10124 }10130 }
10125 else {10131 else {
10132 warn $EVAL_ERROR;
10126 die "--replicate database $db does not exist and it cannot be "10133 die "--replicate database $db does not exist and it cannot be "
10127 . "created automatically. You need to create the database. "10134 . "created automatically. You need to create the database.\n";
10128 . $EVAL_ERROR;
10129 }10135 }
10130 }10136 }
10131 }10137 }
@@ -10193,9 +10199,9 @@
10193 }10199 }
10194 }10200 }
10195 else {10201 else {
10202 warn $EVAL_ERROR;
10196 die "--replicate table $tbl does not exist and it cannot be "10203 die "--replicate table $tbl does not exist and it cannot be "
10197 . "created automatically. You need to create the table. "10204 . "created automatically. You need to create the table.\n"
10198 . $EVAL_ERROR;
10199 }10205 }
10200 }10206 }
10201 }10207 }
1020210208
=== modified file 'bin/pt-table-sync'
--- bin/pt-table-sync 2012-12-03 03:48:11 +0000
+++ bin/pt-table-sync 2012-12-20 23:20:32 +0000
@@ -7521,11 +7521,16 @@
75217521
7522 if ( !$self->{initialized} ) {7522 if ( !$self->{initialized} ) {
7523 $self->{initialized} = 1;7523 $self->{initialized} = 1;
7524 if ( $self->{resume}->{tbl}7524 if ( $self->{resume}->{tbl} ) {
7525 && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {7525 if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) {
7526 PTDEBUG && _d('Will resume after',7526 PTDEBUG && _d('Will resume after',
7527 join('.', @{$self->{resume}}{qw(db tbl)}));7527 join('.', @{$self->{resume}}{qw(db tbl)}));
7528 $self->{resume}->{after} = 1;7528 $self->{resume}->{after}->{tbl} = 1;
7529 }
7530 if ( !$self->database_is_allowed($self->{resume}->{db}) ) {
7531 PTDEBUG && _d('Will resume after', $self->{resume}->{db});
7532 $self->{resume}->{after}->{db} = 1;
7533 }
7529 }7534 }
7530 }7535 }
75317536
@@ -7623,16 +7628,17 @@
7623 if ( !defined $self->{dbs} ) {7628 if ( !defined $self->{dbs} ) {
7624 my $sql = 'SHOW DATABASES';7629 my $sql = 'SHOW DATABASES';
7625 PTDEBUG && _d($sql);7630 PTDEBUG && _d($sql);
7626 my @dbs = grep { $self->database_is_allowed($_) }7631 my @dbs = grep {
7627 @{$dbh->selectcol_arrayref($sql)};7632 $self->_resume_from_database($_)
7633 &&
7634 $self->database_is_allowed($_)
7635 } @{$dbh->selectcol_arrayref($sql)};
7628 PTDEBUG && _d('Found', scalar @dbs, 'databases');7636 PTDEBUG && _d('Found', scalar @dbs, 'databases');
7629 $self->{dbs} = \@dbs;7637 $self->{dbs} = \@dbs;
7630 }7638 }
76317639
7632 if ( !$self->{db} ) {7640 if ( !$self->{db} ) {
7633 do {7641 $self->{db} = shift @{$self->{dbs}};
7634 $self->{db} = shift @{$self->{dbs}};
7635 } until $self->_resume_from_database($self->{db});
7636 PTDEBUG && _d('Next database:', $self->{db});7642 PTDEBUG && _d('Next database:', $self->{db});
7637 return unless $self->{db};7643 return unless $self->{db};
7638 }7644 }
@@ -7734,9 +7740,15 @@
77347740
7735 my $filter = $self->{filters};7741 my $filter = $self->{filters};
77367742
7737 if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {7743 return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
7738 return 0;7744 general_log
7739 }7745 |slow_log
7746 |innodb_index_stats
7747 |innodb_table_stats
7748 |slave_master_info
7749 |slave_relay_log_info
7750 |slave_worker_info
7751 )$/x;
77407752
7741 if ( $filter->{'ignore-tables'}->{$tbl}7753 if ( $filter->{'ignore-tables'}->{$tbl}
7742 && ($filter->{'ignore-tables'}->{$tbl} eq '*'7754 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
@@ -7805,11 +7817,17 @@
7805 my ($self, $db) = @_;7817 my ($self, $db) = @_;
78067818
7807 return 1 unless $self->{resume}->{db};7819 return 1 unless $self->{resume}->{db};
7808
7809 if ( $db eq $self->{resume}->{db} ) {7820 if ( $db eq $self->{resume}->{db} ) {
7810 PTDEBUG && _d('At resume db', $db);7821 if ( !$self->{resume}->{after}->{db} ) {
7811 delete $self->{resume}->{db};7822 PTDEBUG && _d('Resuming from db', $db);
7812 return 1;7823 delete $self->{resume}->{db};
7824 return 1;
7825 }
7826 else {
7827 PTDEBUG && _d('Resuming after db', $db);
7828 delete $self->{resume}->{db};
7829 delete $self->{resume}->{tbl};
7830 }
7813 }7831 }
78147832
7815 return 0;7833 return 0;
@@ -7821,7 +7839,7 @@
7821 return 1 unless $self->{resume}->{tbl};7839 return 1 unless $self->{resume}->{tbl};
78227840
7823 if ( $tbl eq $self->{resume}->{tbl} ) {7841 if ( $tbl eq $self->{resume}->{tbl} ) {
7824 if ( !$self->{resume}->{after} ) {7842 if ( !$self->{resume}->{after}->{tbl} ) {
7825 PTDEBUG && _d('Resuming from table', $tbl);7843 PTDEBUG && _d('Resuming from table', $tbl);
7826 delete $self->{resume}->{tbl};7844 delete $self->{resume}->{tbl};
7827 return 1;7845 return 1;
78287846
=== modified file 'bin/pt-table-usage'
--- bin/pt-table-usage 2012-11-19 18:47:13 +0000
+++ bin/pt-table-usage 2012-12-20 23:20:32 +0000
@@ -212,7 +212,8 @@
212 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }212 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }
213 grep { defined $info->{$_} }213 grep { defined $info->{$_} }
214 qw(F h P S A))214 qw(F h P S A))
215 . ';mysql_read_default_group=client';215 . ';mysql_read_default_group=client'
216 . ($info->{L} ? ';mysql_local_infile=1' : '');
216 }217 }
217 PTDEBUG && _d($dsn);218 PTDEBUG && _d($dsn);
218 return ($dsn, $info->{u}, $info->{p});219 return ($dsn, $info->{u}, $info->{p});
@@ -241,6 +242,9 @@
241 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),242 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),
242 };243 };
243 @{$defaults}{ keys %$opts } = values %$opts;244 @{$defaults}{ keys %$opts } = values %$opts;
245 if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension
246 $defaults->{mysql_local_infile} = 1;
247 }
244248
245 if ( $opts->{mysql_use_result} ) {249 if ( $opts->{mysql_use_result} ) {
246 $defaults->{mysql_use_result} = 1;250 $defaults->{mysql_use_result} = 1;
247251
=== modified file 'bin/pt-upgrade'
--- bin/pt-upgrade 2012-12-03 03:48:11 +0000
+++ bin/pt-upgrade 2012-12-20 23:20:32 +0000
@@ -11980,7 +11980,8 @@
11980 # ########################################################################11980 # ########################################################################
11981 # Do the version-check11981 # Do the version-check
11982 # ########################################################################11982 # ########################################################################
11983 if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) {11983 if ( $o->get('version-check') ne 'off'
11984 && (!$o->has('quiet') || !$o->get('quiet')) ) {
11984 Pingback::version_check(11985 Pingback::version_check(
11985 instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ],11986 instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ],
11986 protocol => $o->get('version-check'),11987 protocol => $o->get('version-check'),
@@ -11988,6 +11989,15 @@
11988 }11989 }
1198911990
11990 # ########################################################################11991 # ########################################################################
11992 # Disable the query cache.
11993 # ########################################################################
11994 if ( $o->get('disable-query-cache') ) {
11995 foreach my $host ( @$hosts ) {
11996 disable_query_cache($host);
11997 }
11998 }
11999
12000 # ########################################################################
11991 # Short version: do it! Long version: this callback does the main work.12001 # Short version: do it! Long version: this callback does the main work.
11992 # The big picture is:12002 # The big picture is:
11993 # [event] -> exec on hosts -> compare -> aggregate -> [meta-event]12003 # [event] -> exec on hosts -> compare -> aggregate -> [meta-event]
@@ -12385,6 +12395,31 @@
12385 return $dbh;12395 return $dbh;
12386}12396}
1238712397
12398sub disable_query_cache {
12399 my ($host) = @_;
12400 die "I need a host argument" unless $host;
12401 my ($dbh, $host_name) = @{$host}{qw(dbh name)};
12402
12403 my $sql = 'SELECT @@query_cache_type';
12404 PTDEBUG && _d($host_name, $sql);
12405 my ($query_cache_type) = $dbh->selectrow_array($sql);
12406 PTDEBUG && _d($host_name, $query_cache_type);
12407 return if ($query_cache_type || '') =~ m/OFF|0/;
12408
12409 $sql = q/SET SESSION query_cache_type = OFF/;
12410 eval {
12411 PTDEBUG && _d($host_name, $sql);
12412 $dbh->do($sql);
12413 };
12414 if ( $EVAL_ERROR ) {
12415 warn $EVAL_ERROR;
12416 die "Failed to $sql on $host_name. Disable the query cache "
12417 . "manually, or specify --no-disable-query-cache.\n";
12418 }
12419
12420 return;
12421}
12422
12388# Catches signals so we can exit gracefully.12423# Catches signals so we can exit gracefully.
12389sub sig_int {12424sub sig_int {
12390 my ( $signal ) = @_;12425 my ( $signal ) = @_;
@@ -12693,6 +12728,12 @@
12693Fork to the background and detach from the shell. POSIX12728Fork to the background and detach from the shell. POSIX
12694operating systems only.12729operating systems only.
1269512730
12731=item --[no]disable-query-cache
12732
12733default: yes
12734
12735C<SET SESSION query_cache_type = OFF> to disable the query cache.
12736
12696=item --explain-hosts12737=item --explain-hosts
1269712738
12698Print connection information and exit.12739Print connection information and exit.
@@ -12861,7 +12902,7 @@
1286112902
12862=item --set-vars12903=item --set-vars
1286312904
12864type: string; default: wait_timeout=10000,query_cache_type=012905type: string; default: wait_timeout=10000
1286512906
12866Set these MySQL variables. Immediately after connecting to MySQL, this12907Set these MySQL variables. Immediately after connecting to MySQL, this
12867string will be appended to SET and executed.12908string will be appended to SET and executed.
1286812909
=== modified file 'bin/pt-visual-explain'
--- bin/pt-visual-explain 2012-11-19 18:47:13 +0000
+++ bin/pt-visual-explain 2012-12-20 23:20:32 +0000
@@ -1900,7 +1900,8 @@
1900 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }1900 . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" }
1901 grep { defined $info->{$_} }1901 grep { defined $info->{$_} }
1902 qw(F h P S A))1902 qw(F h P S A))
1903 . ';mysql_read_default_group=client';1903 . ';mysql_read_default_group=client'
1904 . ($info->{L} ? ';mysql_local_infile=1' : '');
1904 }1905 }
1905 PTDEBUG && _d($dsn);1906 PTDEBUG && _d($dsn);
1906 return ($dsn, $info->{u}, $info->{p});1907 return ($dsn, $info->{u}, $info->{p});
@@ -1929,6 +1930,9 @@
1929 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),1930 mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0),
1930 };1931 };
1931 @{$defaults}{ keys %$opts } = values %$opts;1932 @{$defaults}{ keys %$opts } = values %$opts;
1933 if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension
1934 $defaults->{mysql_local_infile} = 1;
1935 }
19321936
1933 if ( $opts->{mysql_use_result} ) {1937 if ( $opts->{mysql_use_result} ) {
1934 $defaults->{mysql_use_result} = 1;1938 $defaults->{mysql_use_result} = 1;
19351939
=== modified file 'lib/Sandbox.pm'
--- lib/Sandbox.pm 2012-11-30 18:13:04 +0000
+++ lib/Sandbox.pm 2012-12-20 23:20:32 +0000
@@ -126,12 +126,13 @@
126}126}
127 127
128sub get_dbh_for {128sub get_dbh_for {
129 my ( $self, $server, $cxn_ops ) = @_;129 my ( $self, $server, $cxn_ops, $user ) = @_;
130 _check_server($server);130 _check_server($server);
131 $cxn_ops ||= { AutoCommit => 1 };131 $cxn_ops ||= { AutoCommit => 1 };
132 $user ||= 'msandbox';
132 PTDEBUG && _d('dbh for', $server, 'on port', $port_for{$server});133 PTDEBUG && _d('dbh for', $server, 'on port', $port_for{$server});
133 my $dp = $self->{DSNParser};134 my $dp = $self->{DSNParser};
134 my $dsn = $dp->parse('h=127.0.0.1,u=msandbox,p=msandbox,P=' . $port_for{$server});135 my $dsn = $dp->parse("h=127.0.0.1,u=$user,p=msandbox,P=" . $port_for{$server});
135 my $dbh;136 my $dbh;
136 # This is primarily for the benefit of CompareResults, but it's137 # This is primarily for the benefit of CompareResults, but it's
137 # also quite convenient when using an affected OS138 # also quite convenient when using an affected OS
@@ -335,11 +336,11 @@
335 my $master_dbh = $self->get_dbh_for($args{master} || 'master');336 my $master_dbh = $self->get_dbh_for($args{master} || 'master');
336 my $slave2_dbh = $self->get_dbh_for($args{slave} || 'slave2');337 my $slave2_dbh = $self->get_dbh_for($args{slave} || 'slave2');
337 my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())");338 my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())");
338 $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1");339 $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1 /* wait_for_slaves */");
339 PerconaTest::wait_until(340 PerconaTest::wait_until(
340 sub {341 sub {
341 my ($pong) = $slave2_dbh->selectrow_array(342 my ($pong) = $slave2_dbh->selectrow_array(
342 "SELECT ping FROM percona_test.sentinel WHERE id=1");343 "SELECT ping FROM percona_test.sentinel WHERE id=1 /* wait_for_slaves */");
343 return $ping eq $pong;344 return $ping eq $pong;
344 }, undef, 300345 }, undef, 300
345 );346 );
@@ -542,6 +543,23 @@
542 return "/tmp/$port/my.sandbox.cnf"543 return "/tmp/$port/my.sandbox.cnf"
543}544}
544545
546sub do_as_root {
547 my ($self, $server, @queries) = @_;
548 my $dbh = $self->get_dbh_for($server, undef, 'root');
549 my $ok = 1;
550 eval {
551 foreach my $query ( @queries ) {
552 $dbh->do($query);
553 }
554 };
555 if ( $EVAL_ERROR ) {
556 $ok = 0;
557 warn $EVAL_ERROR;
558 }
559 $dbh->disconnect;
560 return $ok;
561}
562
545sub _d {563sub _d {
546 my ($package, undef, $line) = caller 0;564 my ($package, undef, $line) = caller 0;
547 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }565 @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; }
548566
=== modified file 'lib/SchemaIterator.pm'
--- lib/SchemaIterator.pm 2012-12-05 23:30:29 +0000
+++ lib/SchemaIterator.pm 2012-12-20 23:20:32 +0000
@@ -444,9 +444,15 @@
444 my $filter = $self->{filters};444 my $filter = $self->{filters};
445445
446 # Always auto-skip these pseudo tables.446 # Always auto-skip these pseudo tables.
447 if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) {447 return 0 if $db eq 'mysql' && $tbl =~ m/^(?:
448 return 0;448 general_log
449 }449 |slow_log
450 |innodb_index_stats
451 |innodb_table_stats
452 |slave_master_info
453 |slave_relay_log_info
454 |slave_worker_info
455 )$/x;
450456
451 if ( $filter->{'ignore-tables'}->{$tbl}457 if ( $filter->{'ignore-tables'}->{$tbl}
452 && ($filter->{'ignore-tables'}->{$tbl} eq '*'458 && ($filter->{'ignore-tables'}->{$tbl} eq '*'
453459
=== modified file 'lib/Transformers.pm'
--- lib/Transformers.pm 2012-02-07 14:07:41 +0000
+++ lib/Transformers.pm 2012-12-20 23:20:32 +0000
@@ -193,6 +193,10 @@
193 . (defined $f ? '%09.6f' : '%02d'),193 . (defined $f ? '%09.6f' : '%02d'),
194 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);194 $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s);
195 }195 }
196 # MySQL 5.6+ uses "proper" timestamps
197 elsif ( $val =~ m/^$proper_ts$/ ) {
198 return $val;
199 }
196 return $val;200 return $val;
197}201}
198202
199203
=== modified file 'sandbox/jenkins-test'
--- sandbox/jenkins-test 2012-12-07 21:55:52 +0000
+++ sandbox/jenkins-test 2012-12-20 23:20:32 +0000
@@ -46,6 +46,13 @@
46}46}
4747
48MYSQL_BASE_DIR="$(find_mysql_base_dir $MYSQL)"48MYSQL_BASE_DIR="$(find_mysql_base_dir $MYSQL)"
49
50REFETCH_MYSQL="${REFETCH_MYSQL:-""}"
51if [ "$MYSQL_BASE_DIR" -a "$REFETCH_MYSQL" ]; then
52 rm -rf "$MYSQL_BASE_DIR"
53 MYSQL_BASE_DIR=""
54fi
55
49if [ -z "$MYSQL_BASE_DIR" ]; then56if [ -z "$MYSQL_BASE_DIR" ]; then
50 (57 (
51 cd $MYSQL_BIN_DIR58 cd $MYSQL_BIN_DIR
@@ -66,8 +73,9 @@
66##########################73##########################
67export PERCONA_TOOLKIT_BRANCH="$PWD"74export PERCONA_TOOLKIT_BRANCH="$PWD"
68export PERCONA_TOOLKIT_SANDBOX="$MYSQL_BASE_DIR"75export PERCONA_TOOLKIT_SANDBOX="$MYSQL_BASE_DIR"
69export PATH="$PATH:/usr/sbin:$MYSQL_BASE_DIR/bin"76export PATH="$PATH:/usr/sbin:/usr/local/bin:$MYSQL_BASE_DIR/bin"
70export LANG="en_US.UTF-8"77export LANG="en_US.UTF-8"
78export USER="${USER:-"jenkins"}"
7179
72# ######################################### #80# ######################################### #
73# Remove conf files that's shouldn't exist. #81# Remove conf files that's shouldn't exist. #
7482
=== modified file 'sandbox/servers/5.6/data.tar.gz'
75Binary 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:32 +0000 differ83Binary 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:32 +0000 differ
=== modified file 'sandbox/start-sandbox'
--- sandbox/start-sandbox 2012-11-16 19:08:49 +0000
+++ sandbox/start-sandbox 2012-12-20 23:20:32 +0000
@@ -34,7 +34,7 @@
34 cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port34 cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port
35 tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port35 tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port
3636
37 for script in `ls $PERCONA_TOOLKIT_BRANCH/sandbox/servers/*`; do37 for script in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/"*; do
38 if [ -f $script ]; then38 if [ -f $script ]; then
39 cp $script /tmp/$port39 cp $script /tmp/$port
40 fi40 fi
@@ -52,6 +52,10 @@
52 if [ -n "${master_port}" ]; then52 if [ -n "${master_port}" ]; then
53 local master_listen_port=$(($master_port + 10))53 local master_listen_port=$(($master_port + 10))
54 cluster_address="gcomm://$ip:$master_listen_port"54 cluster_address="gcomm://$ip:$master_listen_port"
55
56 local this_listen_port=$(($port + 10))
57 local this_cluster_address="gcomm://$ip:$this_listen_port"
58 sed -e "s!gcomm://\$!$this_cluster_address!g" -i.bak "/tmp/$master_port/my.sandbox.cnf"
55 fi59 fi
5660
57 sed -e "s/ADDR/$ip/g" -i.bak "/tmp/$port/my.sandbox.cnf"61 sed -e "s/ADDR/$ip/g" -i.bak "/tmp/$port/my.sandbox.cnf"
@@ -85,6 +89,9 @@
85 if [ -n "$SKIP_INNODB" ]; then89 if [ -n "$SKIP_INNODB" ]; then
86 echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf90 echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf
87 echo "default-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf91 echo "default-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf
92 if [ "$version" ">" "5.5" ]; then
93 echo "default-tmp-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf
94 fi
88 fi95 fi
89 if [ -n "$MODE_ANSI" ]; then96 if [ -n "$MODE_ANSI" ]; then
90 echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf97 echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf
@@ -95,6 +102,10 @@
95 if [ -n "$LOCAL_INFILE" ]; then102 if [ -n "$LOCAL_INFILE" ]; then
96 echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf103 echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf
97 fi104 fi
105 if [ -n "$QUERY_CACHE_SIZE" ]; then
106 echo "query_cache_type=1" >> /tmp/$port/my.sandbox.cnf
107 echo "query_cache_size=$QUERY_CACHE_SIZE" >> /tmp/$port/my.sandbox.cnf
108 fi
98109
99 # If the sandbox is a slave, set it read_only.110 # If the sandbox is a slave, set it read_only.
100 if [ "$type" = "slave" ]; then111 if [ "$type" = "slave" ]; then
@@ -112,6 +123,10 @@
112 debug_sandbox $port123 debug_sandbox $port
113 exit 1124 exit 1
114 fi125 fi
126
127 for sql in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/"*.sql; do
128 [ -f "$sql" ] && /tmp/$port/use < $sql
129 done
115 fi130 fi
116 else131 else
117 echo "Sandbox $type $port failed to start." >&2132 echo "Sandbox $type $port failed to start." >&2
@@ -119,6 +134,10 @@
119 exit 1134 exit 1
120 fi135 fi
121136
137 /tmp/$port/use -e "CREATE DATABASE IF NOT EXISTS percona_test";
138 /tmp/$port/use -e "CREATE TABLE IF NOT EXISTS percona_test.sentinel (id INT PRIMARY KEY, ping VARCHAR(64) NOT NULL DEFAULT '')";
139 /tmp/$port/use -e "REPLACE INTO percona_test.sentinel (id, ping) VALUES (1, '')";
140
122 # If the sandbox is a slave, start the slave.141 # If the sandbox is a slave, start the slave.
123 if [ "$type" = "slave" ]; then142 if [ "$type" = "slave" ]; then
124 /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"143 /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"
125144
=== modified file 'sandbox/test-env'
--- sandbox/test-env 2012-12-03 20:06:47 +0000
+++ sandbox/test-env 2012-12-20 23:20:32 +0000
@@ -299,6 +299,12 @@
299 exit_status=$((exit_status | $?))299 exit_status=$((exit_status | $?))
300300
301 if [ "${2:-""}" = "cluster" ]; then301 if [ "${2:-""}" = "cluster" ]; then
302 # Bit of magic here. 'start-sandbox cluster new_node old_node'
303 # changes old_node's my.sandbox.cnf's wsrep_cluster_address to
304 # point to new_node. This is especially useful because otherwise,
305 # calling stop/start like below on 12345 would create a new cluster.
306 /tmp/12345/stop >/dev/null
307 /tmp/12345/start >/dev/null
302 echo -n "Checking that the cluster size is correct... "308 echo -n "Checking that the cluster size is correct... "
303 size=$(/tmp/12345/use -ss -e "SHOW STATUS LIKE 'wsrep_cluster_size'" | awk '{print $2}')309 size=$(/tmp/12345/use -ss -e "SHOW STATUS LIKE 'wsrep_cluster_size'" | awk '{print $2}')
304 if [ ${size:-0} -ne 3 ]; then310 if [ ${size:-0} -ne 3 ]; then
@@ -328,11 +334,10 @@
328 ../util/check-load-data334 ../util/check-load-data
329335
330 ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")336 ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")
331 /tmp/12345/use -e "create table percona_test.sentinel(id int primary key, ping varchar(64) not null default '')"337 /tmp/12345/use -e "UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1";
332 /tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')";
333 echo -n "Waiting for replication to finish..."338 echo -n "Waiting for replication to finish..."
334 for i in $(_seq 60); do339 for i in $(_seq 60); do
335 pong=$(/tmp/12347/use -ss -e 'select ping from percona_test.sentinel where id=1' 2>/dev/null)340 pong=$(/tmp/12347/use -ss -e 'SELECT ping FROM percona_test.sentinel WHERE id=1' 2>/dev/null)
336 [ "$ping" = "$pong" ] && break341 [ "$ping" = "$pong" ] && break
337 echo -n '.'342 echo -n '.'
338 sleep 1343 sleep 1
339344
=== modified file 't/lib/ExplainAnalyzer.t'
--- t/lib/ExplainAnalyzer.t 2012-06-03 17:54:32 +0000
+++ t/lib/ExplainAnalyzer.t 2012-12-20 23:20:32 +0000
@@ -31,9 +31,6 @@
31if ( !$dbh ) {31if ( !$dbh ) {
32 plan skip_all => "Cannot connect to sandbox master";32 plan skip_all => "Cannot connect to sandbox master";
33}33}
34else {
35 plan tests => 17;
36}
3734
38$dbh->do('use sakila');35$dbh->do('use sakila');
3936
@@ -60,7 +57,7 @@
60 key_len => 2,57 key_len => 2,
61 ref => 'const',58 ref => 'const',
62 rows => 1,59 rows => 1,
63 Extra => '',60 Extra => $sandbox_version eq '5.6' ? undef : '',
64 },61 },
65 ],62 ],
66 'Got a simple EXPLAIN result',63 'Got a simple EXPLAIN result',
@@ -81,7 +78,7 @@
81 key_len => 2,78 key_len => 2,
82 ref => 'const',79 ref => 'const',
83 rows => 1,80 rows => 1,
84 Extra => '',81 Extra => $sandbox_version eq '5.6' ? undef : '',
85 },82 },
86 ],83 ],
87 'Got EXPLAIN result for a DELETE',84 'Got EXPLAIN result for a DELETE',
@@ -575,4 +572,4 @@
575# Done.572# Done.
576# #############################################################################573# #############################################################################
577ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");574ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
578exit;575done_testing;
579576
=== modified file 't/lib/NibbleIterator.t'
--- t/lib/NibbleIterator.t 2012-11-28 22:00:30 +0000
+++ t/lib/NibbleIterator.t 2012-12-20 23:20:32 +0000
@@ -713,8 +713,8 @@
713# ############################################################################713# ############################################################################
714$ni = make_nibble_iter(714$ni = make_nibble_iter(
715 db => 'mysql',715 db => 'mysql',
716 tbl => 'host',716 tbl => 'columns_priv',
717 argv => [qw(--tables mysql.host --chunk-size-limit 0)],717 argv => [qw(--tables mysql.columns_priv --chunk-size-limit 0)],
718);718);
719719
720@rows = ();720@rows = ();
721721
=== modified file 't/lib/QueryReportFormatter.t'
--- t/lib/QueryReportFormatter.t 2012-11-15 18:17:03 +0000
+++ t/lib/QueryReportFormatter.t 2012-12-20 23:20:32 +0000
@@ -1141,9 +1141,9 @@
1141 );1141 );
11421142
1143 my $explain = load_file(1143 my $explain = load_file(
1144 $sandbox_version ge '5.1'1144 $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report031.txt"
1145 ? "t/lib/samples/QueryReportFormatter/report025.txt"1145 : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report025.txt"
1146 : "t/lib/samples/QueryReportFormatter/report026.txt");1146 : "t/lib/samples/QueryReportFormatter/report026.txt");
11471147
1148 is(1148 is(
1149 $qrf->explain_report("select * from qrf.t where i=2", 'qrf'),1149 $qrf->explain_report("select * from qrf.t where i=2", 'qrf'),
@@ -1180,11 +1180,13 @@
1180 # so if it doesn't USE db then the EXPLAIN will fail. Here we reset1180 # so if it doesn't USE db then the EXPLAIN will fail. Here we reset
1181 # the db to something else because we already called explain_report()1181 # the db to something else because we already called explain_report()
1182 # above which did USE qrf.1182 # above which did USE qrf.
1183 #
1184 # 5.6 really is that different: ia vs. TF>aI. It's smarter.
1183 $dbh->do("USE mysql");1185 $dbh->do("USE mysql");
1184 my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf');1186 my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf');
1185 is(1187 is(
1186 $explain_sparkline,1188 $explain_sparkline,
1187 "TF>aI",1189 $sandbox_version eq '5.6' ? "ia" : "TF>aI",
1188 "explain_sparkling() uses db"1190 "explain_sparkling() uses db"
1189 );1191 );
11901192
@@ -1206,9 +1208,9 @@
1206 groupby => 'fingerprint',1208 groupby => 'fingerprint',
1207 );1209 );
1208 },1210 },
1209 ($sandbox_version ge '5.1' ?1211 ( $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report032.txt"
1210 "t/lib/samples/QueryReportFormatter/report027.txt"1212 : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report027.txt"
1211 : "t/lib/samples/QueryReportFormatter/report029.txt"),1213 : "t/lib/samples/QueryReportFormatter/report029.txt"),
1212 ),1214 ),
1213 "EXPLAIN sparkline (issue 1141)"1215 "EXPLAIN sparkline (issue 1141)"
1214 );1216 );
12151217
=== modified file 't/lib/SchemaIterator.t'
--- t/lib/SchemaIterator.t 2012-12-05 23:30:29 +0000
+++ t/lib/SchemaIterator.t 2012-12-20 23:20:32 +0000
@@ -149,9 +149,7 @@
149 # Test simple, unfiltered get_db_itr().149 # Test simple, unfiltered get_db_itr().
150 # ########################################################################150 # ########################################################################
151 test_so(151 test_so(
152 result => $sandbox_version ge '5.5' ? "$out/all-dbs-tbls.txt"152 result => "$out/all-dbs-tbls-$sandbox_version.txt",
153 : $sandbox_version ge '5.1' ? "$out/all-dbs-tbls-5.1.txt"
154 : "$out/all-dbs-tbls-5.0.txt",
155 test_name => "Iterate all schema objects with dbh",153 test_name => "Iterate all schema objects with dbh",
156 );154 );
157155
@@ -331,9 +329,7 @@
331 # ########################################################################329 # ########################################################################
332 test_so(330 test_so(
333 filters => [qw(-t mysql.user)],331 filters => [qw(-t mysql.user)],
334 result => $sandbox_version ge '5.5' ? "$out/mysql-user-ddl-5.5.txt"332 result => "$out/mysql-user-ddl-$sandbox_version.txt",
335 : $sandbox_version ge '5.1' ? "$out/mysql-user-ddl.txt"
336 : "$out/mysql-user-ddl-5.0.txt",
337 test_name => "Get CREATE TABLE with dbh",333 test_name => "Get CREATE TABLE with dbh",
338 );334 );
339335
340336
=== modified file 't/lib/bash/collect_system_info.sh'
--- t/lib/bash/collect_system_info.sh 2012-08-24 22:39:58 +0000
+++ t/lib/bash/collect_system_info.sh 2012-12-20 23:20:32 +0000
@@ -267,7 +267,7 @@
267) 2>/dev/null &267) 2>/dev/null &
268forked_pid="$!"268forked_pid="$!"
269269
270if [ -e /proc/$forked_pid/oom_adj ] \270if [ -w /proc/$forked_pid/oom_adj ] \
271 && echo "-17" > /proc/$forked_pid/oom_adj 2>/dev/null; then271 && echo "-17" > /proc/$forked_pid/oom_adj 2>/dev/null; then
272272
273 notable_processes_info > "$PT_TMPDIR/notable_procs"273 notable_processes_info > "$PT_TMPDIR/notable_procs"
@@ -277,7 +277,7 @@
277 "notable_proccesses_info finds the process we manually changed earlier"277 "notable_proccesses_info finds the process we manually changed earlier"
278278
279else279else
280 skip 1 1 "Either this OS doesn't have an oom, or this user doesn't have enough privileges to change the oom of other processes"280 skip 1 1 "oom_adj doesn't exist or isn't writeable"
281fi281fi
282282
283disown $forked_pid283disown $forked_pid
284284
=== added file 't/lib/samples/QueryReportFormatter/report031.txt'
--- t/lib/samples/QueryReportFormatter/report031.txt 1970-01-01 00:00:00 +0000
+++ t/lib/samples/QueryReportFormatter/report031.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,12 @@
1# *************************** 1. row ***************************
2# id: 1
3# select_type: SIMPLE
4# table: t
5# partitions: NULL
6# type: const
7# possible_keys: PRIMARY
8# key: PRIMARY
9# key_len: 4
10# ref: const
11# rows: 1
12# Extra: NULL
013
=== added file 't/lib/samples/QueryReportFormatter/report032.txt'
--- t/lib/samples/QueryReportFormatter/report032.txt 1970-01-01 00:00:00 +0000
+++ t/lib/samples/QueryReportFormatter/report032.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,58 @@
1
2# Profile
3# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
4# ==== ================== ============= ===== ====== ==== ===== ======= =========
5# 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 ia SELECT t
6# MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS>
7
8# Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________
9# Scores: Apdex = NS [0.0]*, V/M = 0.00
10# EXPLAIN sparkline: ia
11# Query_time sparkline: | ^ |
12# Time range: all events occurred at 2009-12-08 09:23:49.637394
13# Attribute pct total min max avg 95% stddev median
14# ============ === ======= ======= ======= ======= ======= ======= =======
15# Count 100 1
16# Exec time 100 286us 286us 286us 286us 286us 0 286us
17# Query size 100 90 90 90 90 90 0 90
18# String:
19# cmd Query
20# Databases qrf
21# Query_time distribution
22# 1us
23# 10us
24# 100us ################################################################
25# 1ms
26# 10ms
27# 100ms
28# 1s
29# 10s+
30# Tables
31# SHOW TABLE STATUS FROM `qrf` LIKE 't'\G
32# SHOW CREATE TABLE `qrf`.`t`\G
33# EXPLAIN /*!50100 PARTITIONS*/
34select 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
35# *************************** 1. row ***************************
36# id: 1
37# select_type: SIMPLE
38# table: t1
39# partitions: NULL
40# type: index
41# possible_keys: PRIMARY
42# key: PRIMARY
43# key_len: 4
44# ref: NULL
45# rows: 4
46# Extra: Using where
47# *************************** 2. row ***************************
48# id: 1
49# select_type: SIMPLE
50# table: t2
51# partitions: NULL
52# type: ALL
53# possible_keys: PRIMARY
54# key: NULL
55# key_len: NULL
56# ref: NULL
57# rows: 4
58# Extra: Range checked for each record (index map: 0x1)
059
=== renamed file 't/lib/samples/SchemaIterator/all-dbs-tbls.txt' => 't/lib/samples/SchemaIterator/all-dbs-tbls-5.5.txt'
=== added file 't/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt'
--- t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 1970-01-01 00:00:00 +0000
+++ t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,537 @@
1mysql.columns_priv
2CREATE TABLE `columns_priv` (
3 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
4 `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
5 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
6 `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
7 `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
8 `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
9 `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
10 PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
11) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
12
13mysql.db
14CREATE TABLE `db` (
15 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
16 `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
17 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
18 `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
19 `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
20 `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
21 `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
22 `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
23 `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
24 `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
25 `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
26 `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
27 `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
28 `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
29 `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
30 `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
31 `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
32 `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
33 `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
34 `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
35 `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
36 `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
37 PRIMARY KEY (`Host`,`Db`,`User`),
38 KEY `User` (`User`)
39) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
40
41mysql.event
42CREATE TABLE `event` (
43 `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
44 `name` char(64) NOT NULL DEFAULT '',
45 `body` longblob NOT NULL,
46 `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
47 `execute_at` datetime DEFAULT NULL,
48 `interval_value` int(11) DEFAULT NULL,
49 `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,
50 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
51 `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
52 `last_executed` datetime DEFAULT NULL,
53 `starts` datetime DEFAULT NULL,
54 `ends` datetime DEFAULT NULL,
55 `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
56 `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
57 `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 '',
58 `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
59 `originator` int(10) unsigned NOT NULL,
60 `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
61 `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
62 `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
63 `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
64 `body_utf8` longblob,
65 PRIMARY KEY (`db`,`name`)
66) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
67
68mysql.func
69CREATE TABLE `func` (
70 `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
71 `ret` tinyint(1) NOT NULL DEFAULT '0',
72 `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
73 `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
74 PRIMARY KEY (`name`)
75) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
76
77mysql.help_category
78CREATE TABLE `help_category` (
79 `help_category_id` smallint(5) unsigned NOT NULL,
80 `name` char(64) NOT NULL,
81 `parent_category_id` smallint(5) unsigned DEFAULT NULL,
82 `url` char(128) NOT NULL,
83 PRIMARY KEY (`help_category_id`),
84 UNIQUE KEY `name` (`name`)
85) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories'
86
87mysql.help_keyword
88CREATE TABLE `help_keyword` (
89 `help_keyword_id` int(10) unsigned NOT NULL,
90 `name` char(64) NOT NULL,
91 PRIMARY KEY (`help_keyword_id`),
92 UNIQUE KEY `name` (`name`)
93) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords'
94
95mysql.help_relation
96CREATE TABLE `help_relation` (
97 `help_topic_id` int(10) unsigned NOT NULL,
98 `help_keyword_id` int(10) unsigned NOT NULL,
99 PRIMARY KEY (`help_keyword_id`,`help_topic_id`)
100) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation'
101
102mysql.help_topic
103CREATE TABLE `help_topic` (
104 `help_topic_id` int(10) unsigned NOT NULL,
105 `name` char(64) NOT NULL,
106 `help_category_id` smallint(5) unsigned NOT NULL,
107 `description` text NOT NULL,
108 `example` text NOT NULL,
109 `url` char(128) NOT NULL,
110 PRIMARY KEY (`help_topic_id`),
111 UNIQUE KEY `name` (`name`)
112) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics'
113
114mysql.ndb_binlog_index
115CREATE TABLE `ndb_binlog_index` (
116 `Position` bigint(20) unsigned NOT NULL,
117 `File` varchar(255) NOT NULL,
118 `epoch` bigint(20) unsigned NOT NULL,
119 `inserts` int(10) unsigned NOT NULL,
120 `updates` int(10) unsigned NOT NULL,
121 `deletes` int(10) unsigned NOT NULL,
122 `schemaops` int(10) unsigned NOT NULL,
123 `orig_server_id` int(10) unsigned NOT NULL,
124 `orig_epoch` bigint(20) unsigned NOT NULL,
125 `gci` int(10) unsigned NOT NULL,
126 PRIMARY KEY (`epoch`,`orig_server_id`,`orig_epoch`)
127) ENGINE=MyISAM DEFAULT CHARSET=latin1
128
129mysql.plugin
130CREATE TABLE `plugin` (
131 `name` varchar(64) NOT NULL DEFAULT '',
132 `dl` varchar(128) NOT NULL DEFAULT '',
133 PRIMARY KEY (`name`)
134) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins'
135
136mysql.proc
137CREATE TABLE `proc` (
138 `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
139 `name` char(64) NOT NULL DEFAULT '',
140 `type` enum('FUNCTION','PROCEDURE') NOT NULL,
141 `specific_name` char(64) NOT NULL DEFAULT '',
142 `language` enum('SQL') NOT NULL DEFAULT 'SQL',
143 `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
144 `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
145 `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
146 `param_list` blob NOT NULL,
147 `returns` longblob NOT NULL,
148 `body` longblob NOT NULL,
149 `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
150 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
151 `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
152 `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 '',
153 `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
154 `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
155 `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
156 `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
157 `body_utf8` longblob,
158 PRIMARY KEY (`db`,`name`,`type`)
159) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
160
161mysql.procs_priv
162CREATE TABLE `procs_priv` (
163 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
164 `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
165 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
166 `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '',
167 `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
168 `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
169 `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
170 `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
171 PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
172 KEY `Grantor` (`Grantor`)
173) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
174
175mysql.proxies_priv
176CREATE TABLE `proxies_priv` (
177 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
178 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
179 `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
180 `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
181 `With_grant` tinyint(1) NOT NULL DEFAULT '0',
182 `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
183 `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
184 PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
185 KEY `Grantor` (`Grantor`)
186) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'
187
188mysql.servers
189CREATE TABLE `servers` (
190 `Server_name` char(64) NOT NULL DEFAULT '',
191 `Host` char(64) NOT NULL DEFAULT '',
192 `Db` char(64) NOT NULL DEFAULT '',
193 `Username` char(64) NOT NULL DEFAULT '',
194 `Password` char(64) NOT NULL DEFAULT '',
195 `Port` int(4) NOT NULL DEFAULT '0',
196 `Socket` char(64) NOT NULL DEFAULT '',
197 `Wrapper` char(64) NOT NULL DEFAULT '',
198 `Owner` char(64) NOT NULL DEFAULT '',
199 PRIMARY KEY (`Server_name`)
200) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'
201
202mysql.tables_priv
203CREATE TABLE `tables_priv` (
204 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
205 `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
206 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
207 `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
208 `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
209 `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
210 `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
211 `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
212 PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
213 KEY `Grantor` (`Grantor`)
214) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
215
216mysql.time_zone
217CREATE TABLE `time_zone` (
218 `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
219 `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N',
220 PRIMARY KEY (`Time_zone_id`)
221) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones'
222
223mysql.time_zone_leap_second
224CREATE TABLE `time_zone_leap_second` (
225 `Transition_time` bigint(20) NOT NULL,
226 `Correction` int(11) NOT NULL,
227 PRIMARY KEY (`Transition_time`)
228) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones'
229
230mysql.time_zone_name
231CREATE TABLE `time_zone_name` (
232 `Name` char(64) NOT NULL,
233 `Time_zone_id` int(10) unsigned NOT NULL,
234 PRIMARY KEY (`Name`)
235) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names'
236
237mysql.time_zone_transition
238CREATE TABLE `time_zone_transition` (
239 `Time_zone_id` int(10) unsigned NOT NULL,
240 `Transition_time` bigint(20) NOT NULL,
241 `Transition_type_id` int(10) unsigned NOT NULL,
242 PRIMARY KEY (`Time_zone_id`,`Transition_time`)
243) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions'
244
245mysql.time_zone_transition_type
246CREATE TABLE `time_zone_transition_type` (
247 `Time_zone_id` int(10) unsigned NOT NULL,
248 `Transition_type_id` int(10) unsigned NOT NULL,
249 `Offset` int(11) NOT NULL DEFAULT '0',
250 `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0',
251 `Abbreviation` char(8) NOT NULL DEFAULT '',
252 PRIMARY KEY (`Time_zone_id`,`Transition_type_id`)
253) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types'
254
255mysql.user
256CREATE TABLE `user` (
257 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
258 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
259 `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
260 `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
261 `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
262 `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
263 `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
264 `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
265 `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
266 `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
267 `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
268 `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
269 `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
270 `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
271 `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
272 `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
273 `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
274 `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
275 `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
276 `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
277 `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
278 `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
279 `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
280 `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
281 `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
282 `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
283 `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
284 `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
285 `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
286 `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
287 `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
288 `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
289 `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
290 `ssl_cipher` blob NOT NULL,
291 `x509_issuer` blob NOT NULL,
292 `x509_subject` blob NOT NULL,
293 `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
294 `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
295 `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
296 `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
297 `plugin` char(64) COLLATE utf8_bin DEFAULT '',
298 `authentication_string` text COLLATE utf8_bin,
299 `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
300 PRIMARY KEY (`Host`,`User`)
301) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
302
303percona_test.checksums
304CREATE TABLE `checksums` (
305 `db_tbl` varchar(128) NOT NULL,
306 `checksum` int(10) unsigned NOT NULL,
307 PRIMARY KEY (`db_tbl`)
308) ENGINE=InnoDB DEFAULT CHARSET=latin1
309
310percona_test.load_data
311CREATE TABLE `load_data` (
312 `i` int(11) DEFAULT NULL
313) ENGINE=InnoDB DEFAULT CHARSET=latin1
314
315percona_test.sentinel
316CREATE TABLE `sentinel` (
317 `id` int(11) NOT NULL,
318 `ping` varchar(64) NOT NULL DEFAULT '',
319 PRIMARY KEY (`id`)
320) ENGINE=InnoDB DEFAULT CHARSET=latin1
321
322sakila.actor
323CREATE TABLE `actor` (
324 `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
325 `first_name` varchar(45) NOT NULL,
326 `last_name` varchar(45) NOT NULL,
327 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
328 PRIMARY KEY (`actor_id`),
329 KEY `idx_actor_last_name` (`last_name`)
330) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8
331
332sakila.address
333CREATE TABLE `address` (
334 `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
335 `address` varchar(50) NOT NULL,
336 `address2` varchar(50) DEFAULT NULL,
337 `district` varchar(20) NOT NULL,
338 `city_id` smallint(5) unsigned NOT NULL,
339 `postal_code` varchar(10) DEFAULT NULL,
340 `phone` varchar(20) NOT NULL,
341 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
342 PRIMARY KEY (`address_id`),
343 KEY `idx_fk_city_id` (`city_id`),
344 CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE
345) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8
346
347sakila.category
348CREATE TABLE `category` (
349 `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
350 `name` varchar(25) NOT NULL,
351 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
352 PRIMARY KEY (`category_id`)
353) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8
354
355sakila.city
356CREATE TABLE `city` (
357 `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
358 `city` varchar(50) NOT NULL,
359 `country_id` smallint(5) unsigned NOT NULL,
360 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
361 PRIMARY KEY (`city_id`),
362 KEY `idx_fk_country_id` (`country_id`),
363 CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE
364) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8
365
366sakila.country
367CREATE TABLE `country` (
368 `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
369 `country` varchar(50) NOT NULL,
370 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
371 PRIMARY KEY (`country_id`)
372) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8
373
374sakila.customer
375CREATE TABLE `customer` (
376 `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
377 `store_id` tinyint(3) unsigned NOT NULL,
378 `first_name` varchar(45) NOT NULL,
379 `last_name` varchar(45) NOT NULL,
380 `email` varchar(50) DEFAULT NULL,
381 `address_id` smallint(5) unsigned NOT NULL,
382 `active` tinyint(1) NOT NULL DEFAULT '1',
383 `create_date` datetime NOT NULL,
384 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
385 PRIMARY KEY (`customer_id`),
386 KEY `idx_fk_store_id` (`store_id`),
387 KEY `idx_fk_address_id` (`address_id`),
388 KEY `idx_last_name` (`last_name`),
389 CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE,
390 CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE
391) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8
392
393sakila.film
394CREATE TABLE `film` (
395 `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
396 `title` varchar(255) NOT NULL,
397 `description` text,
398 `release_year` year(4) DEFAULT NULL,
399 `language_id` tinyint(3) unsigned NOT NULL,
400 `original_language_id` tinyint(3) unsigned DEFAULT NULL,
401 `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3',
402 `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99',
403 `length` smallint(5) unsigned DEFAULT NULL,
404 `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99',
405 `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G',
406 `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL,
407 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
408 PRIMARY KEY (`film_id`),
409 KEY `idx_title` (`title`),
410 KEY `idx_fk_language_id` (`language_id`),
411 KEY `idx_fk_original_language_id` (`original_language_id`),
412 CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE,
413 CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE
414) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8
415
416sakila.film_actor
417CREATE TABLE `film_actor` (
418 `actor_id` smallint(5) unsigned NOT NULL,
419 `film_id` smallint(5) unsigned NOT NULL,
420 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
421 PRIMARY KEY (`actor_id`,`film_id`),
422 KEY `idx_fk_film_id` (`film_id`),
423 CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE,
424 CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
425) ENGINE=InnoDB DEFAULT CHARSET=utf8
426
427sakila.film_category
428CREATE TABLE `film_category` (
429 `film_id` smallint(5) unsigned NOT NULL,
430 `category_id` tinyint(3) unsigned NOT NULL,
431 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
432 PRIMARY KEY (`film_id`,`category_id`),
433 KEY `fk_film_category_category` (`category_id`),
434 CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE,
435 CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE
436) ENGINE=InnoDB DEFAULT CHARSET=utf8
437
438sakila.film_text
439CREATE TABLE `film_text` (
440 `film_id` smallint(6) NOT NULL,
441 `title` varchar(255) NOT NULL,
442 `description` text,
443 PRIMARY KEY (`film_id`),
444 FULLTEXT KEY `idx_title_description` (`title`,`description`)
445) ENGINE=MyISAM DEFAULT CHARSET=utf8
446
447sakila.inventory
448CREATE TABLE `inventory` (
449 `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
450 `film_id` smallint(5) unsigned NOT NULL,
451 `store_id` tinyint(3) unsigned NOT NULL,
452 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
453 PRIMARY KEY (`inventory_id`),
454 KEY `idx_fk_film_id` (`film_id`),
455 KEY `idx_store_id_film_id` (`store_id`,`film_id`),
456 CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
457 CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE
458) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8
459
460sakila.language
461CREATE TABLE `language` (
462 `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
463 `name` char(20) NOT NULL,
464 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
465 PRIMARY KEY (`language_id`)
466) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8
467
468sakila.payment
469CREATE TABLE `payment` (
470 `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
471 `customer_id` smallint(5) unsigned NOT NULL,
472 `staff_id` tinyint(3) unsigned NOT NULL,
473 `rental_id` int(11) DEFAULT NULL,
474 `amount` decimal(5,2) NOT NULL,
475 `payment_date` datetime NOT NULL,
476 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
477 PRIMARY KEY (`payment_id`),
478 KEY `idx_fk_staff_id` (`staff_id`),
479 KEY `idx_fk_customer_id` (`customer_id`),
480 KEY `fk_payment_rental` (`rental_id`),
481 CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE,
482 CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
483 CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
484) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8
485
486sakila.rental
487CREATE TABLE `rental` (
488 `rental_id` int(11) NOT NULL AUTO_INCREMENT,
489 `rental_date` datetime NOT NULL,
490 `inventory_id` mediumint(8) unsigned NOT NULL,
491 `customer_id` smallint(5) unsigned NOT NULL,
492 `return_date` datetime DEFAULT NULL,
493 `staff_id` tinyint(3) unsigned NOT NULL,
494 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
495 PRIMARY KEY (`rental_id`),
496 UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`),
497 KEY `idx_fk_inventory_id` (`inventory_id`),
498 KEY `idx_fk_customer_id` (`customer_id`),
499 KEY `idx_fk_staff_id` (`staff_id`),
500 CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
501 CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE,
502 CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE
503) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8
504
505sakila.staff
506CREATE TABLE `staff` (
507 `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
508 `first_name` varchar(45) NOT NULL,
509 `last_name` varchar(45) NOT NULL,
510 `address_id` smallint(5) unsigned NOT NULL,
511 `picture` blob,
512 `email` varchar(50) DEFAULT NULL,
513 `store_id` tinyint(3) unsigned NOT NULL,
514 `active` tinyint(1) NOT NULL DEFAULT '1',
515 `username` varchar(16) NOT NULL,
516 `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
517 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
518 PRIMARY KEY (`staff_id`),
519 KEY `idx_fk_store_id` (`store_id`),
520 KEY `idx_fk_address_id` (`address_id`),
521 CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE,
522 CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
523) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
524
525sakila.store
526CREATE TABLE `store` (
527 `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
528 `manager_staff_id` tinyint(3) unsigned NOT NULL,
529 `address_id` smallint(5) unsigned NOT NULL,
530 `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
531 PRIMARY KEY (`store_id`),
532 UNIQUE KEY `idx_unique_manager` (`manager_staff_id`),
533 KEY `idx_fk_address_id` (`address_id`),
534 CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE,
535 CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE
536) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8
537
0538
=== renamed file 't/lib/samples/SchemaIterator/mysql-user-ddl.txt' => 't/lib/samples/SchemaIterator/mysql-user-ddl-5.1.txt'
=== added file 't/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt'
--- t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 1970-01-01 00:00:00 +0000
+++ t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,48 @@
1mysql.user
2CREATE TABLE `user` (
3 `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
4 `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
5 `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
6 `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
7 `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
8 `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
9 `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
10 `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
11 `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
12 `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
13 `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
14 `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
15 `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
16 `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
17 `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
18 `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
19 `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
20 `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
21 `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
22 `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
23 `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
24 `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
25 `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
26 `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
27 `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
28 `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
29 `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
30 `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
31 `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
32 `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
33 `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
34 `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
35 `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
36 `ssl_cipher` blob NOT NULL,
37 `x509_issuer` blob NOT NULL,
38 `x509_subject` blob NOT NULL,
39 `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
40 `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
41 `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
42 `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
43 `plugin` char(64) COLLATE utf8_bin DEFAULT '',
44 `authentication_string` text COLLATE utf8_bin,
45 `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
46 PRIMARY KEY (`Host`,`User`)
47) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
48
049
=== added file 't/lib/samples/stored-objs.sql'
--- t/lib/samples/stored-objs.sql 1970-01-01 00:00:00 +0000
+++ t/lib/samples/stored-objs.sql 2012-12-20 23:20:32 +0000
@@ -0,0 +1,30 @@
1DROP DATABASE IF EXISTS pt_find;
2CREATE DATABASE pt_find;
3USE pt_find;
4
5create table t1 (
6 id int not null primary key
7) engine=innodb;
8
9create table t2 (
10 id int not null primary key
11) engine=innodb;
12
13CREATE FUNCTION hello (s CHAR(20))
14RETURNS CHAR(50) DETERMINISTIC
15RETURN CONCAT('Hello, ',s,'!');
16
17delimiter //
18
19CREATE PROCEDURE simpleproc (OUT param1 INT)
20BEGIN
21 SELECT COUNT(*) INTO param1 FROM t;
22END//
23
24CREATE TRIGGER ins_trg BEFORE INSERT ON t1
25 FOR EACH ROW BEGIN
26 INSERT INTO t2 VALUES (NEW.id);
27 END;
28//
29
30delimiter ;
031
=== modified file 't/pt-archiver/standard_options.t'
--- t/pt-archiver/standard_options.t 2012-06-07 03:14:20 +0000
+++ t/pt-archiver/standard_options.t 2012-12-20 23:20:32 +0000
@@ -23,101 +23,127 @@
23if ( !$dbh ) {23if ( !$dbh ) {
24 plan skip_all => 'Cannot connect to sandbox master';24 plan skip_all => 'Cannot connect to sandbox master';
25}25}
26else {26elsif ( !$dbh2 ) {
27 plan tests => 7;27 plan skip_all => 'Cannot connect to sandbox slave';
28}28}
2929
30my $output;30my $output;
31my $cnf = "/tmp/12345/my.sandbox.cnf";31my $cnf = "/tmp/12345/my.sandbox.cnf";
32my $cmd = "$trunk/bin/pt-archiver";32my $pid_file = "/tmp/pt-archiver-test.pid.$PID";
33my $sentinel = "/tmp/pt-archiver-test.sentinel.$PID";
3334
34$sb->create_dbs($dbh, [qw(test)]);35$sb->create_dbs($dbh, [qw(test)]);
3536
36SKIP: {37ok(
37 skip 'Sandbox master does not have the sakila database', 138 no_diff(
38 unless @{$dbh->selectcol_arrayref("SHOW DATABASES LIKE 'sakila'")};39 sub {
3940 pt_archiver::main('--source', "F=$cnf,h=127.1,D=sakila,t=film",
40 $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 -`;41 qw(--no-check-charset --purge --dry-run --port 12345),
41 is(42 "--where", "film_id < 100")
42 $output,43 },
43 '',44 "t/pt-archiver/samples/issue-248.txt",
44 'DSNs inherit from standard connection options (issue 248)'45 ),
45 );46 'DSNs inherit from standard connection options (issue 248)'
46};47);
47
4848
49# Test with a sentinel file49# Test with a sentinel file
50$sb->load_file('master', 't/pt-archiver/samples/table1.sql');50$sb->load_file('master', 't/pt-archiver/samples/table1.sql');
51diag(`touch sentinel`);51diag(`touch $sentinel`);
52
52$output = output(53$output = output(
53 sub { pt_archiver::main(qw(--where 1=1 --why-quit --sentinel sentinel), "--source", "D=test,t=table_1,F=$cnf", qw(--purge)) },54 sub { pt_archiver::main("--source", "D=test,t=table_1,F=$cnf",
54);55 qw(--where 1=1 --why-quit --purge),
55like($output, qr/because sentinel/, 'Exits because of sentinel');56 "--sentinel", $sentinel)
57 },
58 stderr => 1,
59);
60
61like(
62 $output,
63 qr/because sentinel file $sentinel exists/,
64 'Exits because of sentinel'
65);
66
56$output = `/tmp/12345/use -N -e "select count(*) from test.table_1"`;67$output = `/tmp/12345/use -N -e "select count(*) from test.table_1"`;
57is($output + 0, 4, 'No rows were deleted');68is(
58`rm sentinel`;69 $output + 0,
70 4,
71 'No rows were deleted'
72) or diag($output);
73
74diag(`rm -f $sentinel`);
5975
60# Test --stop, which sets the sentinel76# Test --stop, which sets the sentinel
61$output = output(77$output = output(
62 sub { pt_archiver::main(qw(--sentinel sentinel --stop)) },78 sub { pt_archiver::main("--sentinel", $sentinel, "--stop") },
63);79);
64like($output, qr/Successfully created file sentinel/, 'Created the sentinel OK');80
65diag(`rm -f sentinel >/dev/null`);81like(
82 $output,
83 qr/Successfully created file $sentinel/,
84 'Created the sentinel OK'
85);
86
87diag(`rm -f $sentinel`);
6688
67# #############################################################################89# #############################################################################
68# Issue 391: Add --pid option to mk-table-sync90# Issue 391: Add --pid option to mk-table-sync
69# #############################################################################91# #############################################################################
70`touch /tmp/mk-archiver.pid`;92diag(`touch $pid_file`);
71$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`;93
94$output = output(
95 sub { pt_archiver::main('--source', "F=$cnf,D=test,t=issue_131_src",
96 qw(--where 1=1 --statistics --dest t=issue_131_dst),
97 "--pid", $pid_file)
98 },
99 stderr => 1,
100);
101
72like(102like(
73 $output,103 $output,
74 qr{PID file /tmp/mk-archiver.pid already exists},104 qr{PID file $pid_file already exists},
75 'Dies if PID file already exists (issue 391)'105 'Dies if PID file already exists (issue 391)'
76);106);
77107
78`rm -rf /tmp/mk-archiver.pid`;108diag(`rm -f $pid_file`);
79109
80# #############################################################################110# #############################################################################
81# Issue 460: mk-archiver does not inherit DSN as documented 111# Issue 460: mk-archiver does not inherit DSN as documented
82# #############################################################################112# #############################################################################
83SKIP: {113
84 skip 'Cannot connect to sandbox slave1', 1 unless $dbh2;114# This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.
85115$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
86 # This test will achive rows from dbh:test.table_1 to dbh2:test.table_2.116
87 $sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');117# Change passwords so defaults files won't work.
88118$sb->do_as_root(
89 # Change passwords so defaults files won't work.119 'master',
90 $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('foo')");120 q/CREATE USER 'bob'@'%' IDENTIFIED BY 'foo'/,
91 $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('foo')");121 q/GRANT ALL ON *.* TO 'bob'@'%'/,
92122);
93 $dbh2->do('TRUNCATE TABLE test.table_2');123$dbh2->do('TRUNCATE TABLE test.table_2');
94124$sb->wait_for_slaves;
95 $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`;125
96 my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2');126$output = output(
97 is(127 sub { pt_archiver::main(
98 scalar @$r,128 '--source', 'h=127.1,P=12345,D=test,t=table_1,u=bob,p=foo',
99 4,129 '--dest', 'P=12346,t=table_2',
100 '--dest inherited from --source'130 qw(--where 1=1))
101 );131 },
102132 stderr => 1,
103 # Set the passwords back. If this fails we should bail out because133);
104 # nothing else is going to work.134
105 eval {135my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2');
106 $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')");136is(
107 $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')");137 scalar @$r,
108 };138 4,
109 if ( $EVAL_ERROR ) {139 '--dest inherited from --source'
110 BAIL_OUT('Failed to reset the msandbox password on the master or slave '140);
111 . 'sandbox. Check the Maatkit test environment with "test-env '141
112 . 'status" and restart with "test-env restart". The error was: '142$sb->do_as_root('master', q/DROP USER 'bob'@'%'/);
113 . $EVAL_ERROR);
114 }
115};
116143
117# #############################################################################144# #############################################################################
118# Done.145# Done.
119# #############################################################################146# #############################################################################
120$sb->wipe_clean($dbh);147$sb->wipe_clean($dbh);
121$sb->wipe_clean($dbh2) if $dbh2;
122ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");148ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
123exit;149done_testing;
124150
=== added file 't/pt-config-diff/samples/case1.cnf'
--- t/pt-config-diff/samples/case1.cnf 1970-01-01 00:00:00 +0000
+++ t/pt-config-diff/samples/case1.cnf 2012-12-20 23:20:32 +0000
@@ -0,0 +1,2 @@
1[mysqld]
2binlog_format = genlog
03
=== added file 't/pt-config-diff/samples/case2.cnf'
--- t/pt-config-diff/samples/case2.cnf 1970-01-01 00:00:00 +0000
+++ t/pt-config-diff/samples/case2.cnf 2012-12-20 23:20:32 +0000
@@ -0,0 +1,2 @@
1[mysqld]
2binlog_format = GENLOG
03
=== modified file 't/pt-deadlock-logger/bugs.t'
--- t/pt-deadlock-logger/bugs.t 2012-06-03 18:47:00 +0000
+++ t/pt-deadlock-logger/bugs.t 2012-12-20 23:20:32 +0000
@@ -9,7 +9,7 @@
9use strict;9use strict;
10use warnings FATAL => 'all';10use warnings FATAL => 'all';
11use English qw(-no_match_vars);11use English qw(-no_match_vars);
12use Test::More tests => 1;12use Test::More;
1313
14use PerconaTest;14use PerconaTest;
15use Sandbox;15use Sandbox;
@@ -68,6 +68,59 @@
68);68);
6969
70# #############################################################################70# #############################################################################
71# https://bugs.launchpad.net/percona-toolkit/+bug/1082104
72# pt-deadlock-logger problem when the user have a dash in the name
73# #############################################################################
74
75$innodb_status_sample = load_file("t/pt-deadlock-logger/samples/bug_1082104.txt");
76
77is_deeply(
78 pt_deadlock_logger::parse_deadlocks($innodb_status_sample),
79 {
80 '1' => {
81 db => 'test',
82 hostname => 'localhost',
83 id => 1,
84 idx => 'PRIMARY',
85 ip => '',
86 lock_mode => 'X',
87 lock_type => 'RECORD',
88 query => 'update a set movie_id=96 where id =2',
89 server => '',
90 tbl => 'a',
91 thread => '19',
92 ts => '2011-12-12T22:52:42',
93 txn_id => 0,
94 txn_time => '161',
95 user => 'ro-ot',
96 victim => 0,
97 wait_hold => 'w'
98 },
99 '2' => {
100 db => 'test',
101 hostname => 'localhost',
102 id => 2,
103 idx => 'PRIMARY',
104 ip => '',
105 lock_mode => 'X',
106 lock_type => 'RECORD',
107 query => 'update a set movie_id=98 where id =4',
108 server => '',
109 tbl => 'a',
110 thread => '18',
111 ts => '2011-12-12T22:52:42',
112 txn_id => 0,
113 txn_time => '1026',
114 user => 'ro-ot',
115 victim => 1,
116 wait_hold => 'w'
117 }
118 },
119 "Bug 1082104: pt-deadlock-logger shows host as user when the username has a dash in the name",
120);
121
122# #############################################################################
71# Done.123# Done.
72# #############################################################################124# #############################################################################
125done_testing;
73exit;126exit;
74127
=== added file 't/pt-deadlock-logger/samples/bug_1082104.txt'
--- t/pt-deadlock-logger/samples/bug_1082104.txt 1970-01-01 00:00:00 +0000
+++ t/pt-deadlock-logger/samples/bug_1082104.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,53 @@
1=====================================
2070915 15:34:37 INNODB MONITOR OUTPUT
3=====================================
4Per second averages calculated from the last 24 seconds
5------------------------
6LATEST DETECTED DEADLOCK
7------------------------
8111212 22:52:42
9*** (1) TRANSACTION:
10TRANSACTION 3405, ACTIVE 161 sec starting index read
11mysql tables in use 1, locked 1
12LOCK WAIT 3 lock struct(s), heap size 376, 3 row lock(s), undo log entries 2
13MySQL thread id 19, OS thread handle 0x7fac301e4700, query id 180 localhost ro-ot Updating
14update a set movie_id=96 where id =2
15*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
16RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3405 lock_mode X locks rec but not gap waiting
17Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
18 0: len 4; hex 80000002; asc ;;
19 1: len 6; hex 000000003404; asc 4 ;;
20 2: len 7; hex 040000163b2515; asc ;% ;;
21 3: len 4; hex 80000063; asc c;;
22 4: len 1; hex 01; asc ;;
23 5: len 8; hex 8000124a7c1acb8c; asc J| ;;
24
25*** (2) TRANSACTION:
26TRANSACTION 3404, ACTIVE 1026 sec starting index read
27mysql tables in use 1, locked 1
283 lock struct(s), heap size 376, 2 row lock(s), undo log entries 1
29MySQL thread id 18, OS thread handle 0x7fac30225700, query id 181 localhost ro-ot Updating
30update a set movie_id=98 where id =4
31*** (2) HOLDS THE LOCK(S):
32RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap
33Record lock, heap no 3 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
34 0: len 4; hex 80000002; asc ;;
35 1: len 6; hex 000000003404; asc 4 ;;
36 2: len 7; hex 040000163b2515; asc ;% ;;
37 3: len 4; hex 80000063; asc c;;
38 4: len 1; hex 01; asc ;;
39 5: len 8; hex 8000124a7c1acb8c; asc J| ;;
40
41*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
42RECORD LOCKS space id 0 page no 307 n bits 72 index `PRIMARY` of table `test`.`a` trx id 3404 lock_mode X locks rec but not gap waiting
43Record lock, heap no 5 PHYSICAL RECORD: n_fields 6; compact format; info bits 0
44 0: len 4; hex 80000004; asc ;;
45 1: len 6; hex 000000003405; asc 4 ;;
46 2: len 7; hex 0500000e7017e8; asc p ;;
47 3: len 4; hex 80000062; asc b;;
48 4: len 1; hex 01; asc ;;
49 5: len 8; hex 8000124a7c1acbb6; asc J| ;;
50
51*** WE ROLL BACK TRANSACTION (2)
52END OF INNODB MONITOR OUTPUT
53============================
054
=== modified file 't/pt-find/pt-find.t'
--- t/pt-find/pt-find.t 2012-12-07 22:46:51 +0000
+++ t/pt-find/pt-find.t 2012-12-20 23:20:32 +0000
@@ -22,9 +22,8 @@
22if ( !$dbh ) {22if ( !$dbh ) {
23 plan skip_all => 'Cannot connect to sandbox master';23 plan skip_all => 'Cannot connect to sandbox master';
24}24}
25else {25
26 plan tests => 23;26$sb->load_file('master', 't/lib/samples/stored-objs.sql');
27}
2827
29my $output;28my $output;
30my $cnf = '/tmp/12345/my.sandbox.cnf';29my $cnf = '/tmp/12345/my.sandbox.cnf';
@@ -111,6 +110,80 @@
111 "--view that doesn't match"110 "--view that doesn't match"
112 );111 );
113112
113 # Test --procedure.
114 $output = `$cmd pt_find --procedure param1 --print`;
115 is(
116 $output,
117 "`pt_find`.`PROCEDURE simpleproc`\n",
118 '--procedure that matches'
119 );
120
121 $output = `$cmd pt_find --procedure blah --print`;
122 is(
123 $output,
124 '',
125 "--procedure that doesn't match"
126 );
127
128 # Test --function.
129 $output = `$cmd pt_find --function Hello --print`;
130 is(
131 $output,
132 "`pt_find`.`FUNCTION hello`\n",
133 '--function that matches'
134 );
135
136 $output = `$cmd pt_find --function blah --print`;
137 is(
138 $output,
139 '',
140 "--function that doesn't match"
141 );
142
143 # Test --trigger without --trigger-table.
144 $output = `$cmd pt_find --trigger 'INSERT INTO t2' --print`;
145 is(
146 $output,
147 "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n",
148 '--trigger that matches without --trigger-table'
149 );
150
151 $output = `$cmd pt_find --trigger blah --print`;
152 is(
153 $output,
154 '',
155 "--trigger that doesn't match without --trigger-table"
156 );
157
158 # Test --trigger with --trigger-table.
159 $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table t1 --print`;
160 is(
161 $output,
162 "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n",
163 '--trigger that matches with matching --trigger-table'
164 );
165
166 $output = `$cmd pt_find --trigger blah --trigger-table t1 --print`;
167 is(
168 $output,
169 '',
170 "--trigger that doesn't match with matching --trigger-table"
171 );
172
173 $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table foo --print`;
174 is(
175 $output,
176 '',
177 '--trigger that matches with non-matching --trigger-table'
178 );
179
180 $output = `$cmd pt_find --trigger blah --trigger-table foo --print`;
181 is(
182 $output,
183 '',
184 "--trigger that doesn't match with non-matching --trigger-table"
185 );
186
114 # Test NULL sizes.187 # Test NULL sizes.
115 $output = `$cmd sakila --datasize NULL`,188 $output = `$cmd sakila --datasize NULL`,
116 is(189 is(
@@ -223,4 +296,5 @@
223# #############################################################################296# #############################################################################
224$sb->wipe_clean($dbh);297$sb->wipe_clean($dbh);
225ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");298ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
299done_testing;
226exit;300exit;
227301
=== added file 't/pt-heartbeat/bugs.t'
--- t/pt-heartbeat/bugs.t 1970-01-01 00:00:00 +0000
+++ t/pt-heartbeat/bugs.t 2012-12-20 23:20:32 +0000
@@ -0,0 +1,115 @@
1#!/usr/bin/env perl
2
3BEGIN {
4 die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
5 unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
6 unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
7};
8
9use strict;
10use warnings FATAL => 'all';
11use English qw(-no_match_vars);
12use Test::More;
13
14use POSIX qw( tzset );
15use File::Temp qw(tempfile);
16
17use PerconaTest;
18use Sandbox;
19require "$trunk/bin/pt-heartbeat";
20
21my $dp = new DSNParser(opts=>$dsn_opts);
22my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
23my $master_dbh = $sb->get_dbh_for('master');
24my $slave1_dbh = $sb->get_dbh_for('slave1');
25my $slave2_dbh = $sb->get_dbh_for('slave2');
26
27if ( !$master_dbh ) {
28 plan skip_all => 'Cannot connect to sandbox master';
29}
30elsif ( !$slave1_dbh ) {
31 plan skip_all => 'Cannot connect to sandbox slave1';
32}
33elsif ( !$slave2_dbh ) {
34 plan skip_all => 'Cannot connect to sandbox slave2';
35}
36
37unlink '/tmp/pt-heartbeat-sentinel';
38$sb->create_dbs($master_dbh, ['test']);
39$sb->wait_for_slaves();
40
41my $output;
42my $base_pidfile = (tempfile("/tmp/pt-heartbeat-test.XXXXXXXX", OPEN => 0, UNLINK => 0))[1];
43my $master_port = $sb->port_for('master');
44
45my @exec_pids;
46my @pidfiles;
47
48sub start_update_instance {
49 my ($port) = @_;
50 my $pidfile = "$base_pidfile.$port.pid";
51 push @pidfiles, $pidfile;
52
53 my $pid = fork();
54 if ( $pid == 0 ) {
55 my $cmd = "$trunk/bin/pt-heartbeat";
56 exec { $cmd } $cmd, qw(-h 127.0.0.1 -u msandbox -p msandbox -P), $port,
57 qw(--database test --table heartbeat --create-table),
58 qw(--update --interval 0.5 --pid), $pidfile;
59 exit 1;
60 }
61 push @exec_pids, $pid;
62
63 PerconaTest::wait_for_files($pidfile);
64 ok(
65 -f $pidfile,
66 "--update on $port started"
67 );
68}
69
70sub stop_all_instances {
71 my @pids = @exec_pids, map { chomp; $_ } map { slurp_file($_) } @pidfiles;
72 diag(`$trunk/bin/pt-heartbeat --stop >/dev/null`);
73
74 waitpid($_, 0) for @pids;
75 PerconaTest::wait_until(sub{ !-e $_ }) for @pidfiles;
76
77 unlink '/tmp/pt-heartbeat-sentinel';
78}
79
80# ############################################################################
81# pt-heartbeat handles timezones inconsistently
82# https://bugs.launchpad.net/percona-toolkit/+bug/886059
83# ############################################################################
84
85start_update_instance( $master_port );
86
87PerconaTest::wait_for_table($slave1_dbh, 'test.heartbeat', 'server_id=12345');
88
89my $slave1_dsn = $sb->dsn_for('slave1');
90# Using full_output here to work around a Perl bug: Only the first explicit
91# tzset works.
92($output) = full_output(sub {
93 local $ENV{TZ} = '-09:00';
94 tzset();
95 pt_heartbeat::main($slave1_dsn, qw(--database test --table heartbeat),
96 qw(--check --master-server-id), $master_port)
97});
98
99# If the servers use UTC then the lag should be 0.00, or at least
100# no greater than 9.99 for slow test boxes. When this fails, the
101# lag is like 25200.00 becaues the servers are hours off.
102like(
103 $output,
104 qr/\A\d.\d{2}$/,
105 "Bug 886059: pt-heartbeat doesn't get confused with differing timezones"
106);
107
108stop_all_instances();
109
110# ############################################################################
111# Done.
112# ############################################################################
113$sb->wipe_clean($master_dbh);
114ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
115done_testing;
0116
=== added file 't/pt-heartbeat/pxc.t'
--- t/pt-heartbeat/pxc.t 1970-01-01 00:00:00 +0000
+++ t/pt-heartbeat/pxc.t 2012-12-20 23:20:32 +0000
@@ -0,0 +1,388 @@
1#!/usr/bin/env perl
2
3BEGIN {
4 die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
5 unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
6 unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
7};
8
9use strict;
10use warnings FATAL => 'all';
11use English qw(-no_match_vars);
12use Test::More;
13use Data::Dumper;
14
15use File::Temp qw(tempfile);
16
17use PerconaTest;
18use Sandbox;
19
20require "$trunk/bin/pt-heartbeat";
21# Do this after requiring pt-hb, since it uses Mo
22require VersionParser;
23
24my $dp = new DSNParser(opts=>$dsn_opts);
25my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
26my $node1 = $sb->get_dbh_for('node1');
27my $node2 = $sb->get_dbh_for('node2');
28my $node3 = $sb->get_dbh_for('node3');
29
30if ( !$node1 ) {
31 plan skip_all => 'Cannot connect to cluster node1';
32}
33elsif ( !$node2 ) {
34 plan skip_all => 'Cannot connect to cluster node2';
35}
36elsif ( !$node3 ) {
37 plan skip_all => 'Cannot connect to cluster node3';
38}
39
40my $db_flavor = VersionParser->new($node1)->flavor();
41if ( $db_flavor !~ /XtraDB Cluster/ ) {
42 plan skip_all => "PXC tests";
43}
44
45my $node1_dsn = $sb->dsn_for('node1');
46my $node2_dsn = $sb->dsn_for('node2');
47my $node3_dsn = $sb->dsn_for('node3');
48my $node1_port = $sb->port_for('node1');
49my $node2_port = $sb->port_for('node2');
50my $node3_port = $sb->port_for('node3');
51
52my $output;
53my $exit;
54my $base_pidfile = (tempfile("/tmp/pt-heartbeat-test.XXXXXXXX", OPEN => 0, UNLINK => 0))[1];
55my $sample = "t/pt-heartbeat/samples/";
56
57my $sentinel = '/tmp/pt-heartbeat-sentinel';
58
59# Remove any leftover instances
60diag(`$trunk/bin/pt-heartbeat --stop >/dev/null`);
61sleep 1;
62
63diag(`rm -rf $sentinel >/dev/null 2>&1`);
64$sb->create_dbs($node1, ['test']);
65
66my @exec_pids;
67my @pidfiles;
68
69sub start_update_instance {
70 my ($port) = @_;
71 my $pidfile = "$base_pidfile.$port.pid";
72 push @pidfiles, $pidfile;
73
74 my $pid = fork();
75 die "Cannot fork: $OS_ERROR" unless defined $pid;
76 if ( $pid == 0 ) {
77 my $cmd = "$trunk/bin/pt-heartbeat";
78 exec { $cmd } $cmd, qw(-h 127.0.0.1 -u msandbox -p msandbox -P), $port,
79 qw(--database test --table heartbeat --create-table),
80 qw(--update --interval 0.5 --pid), $pidfile;
81 exit 1;
82 }
83 push @exec_pids, $pid;
84
85 PerconaTest::wait_for_files($pidfile);
86 ok(
87 -f $pidfile,
88 "--update on $port started"
89 );
90}
91
92sub stop_all_instances {
93 my @pids = @exec_pids, map { chomp; $_ } map { slurp_file($_) } @pidfiles;
94 diag(`$trunk/bin/pt-heartbeat --stop >/dev/null`);
95
96 waitpid($_, 0) for @pids;
97 PerconaTest::wait_until(sub{ !-e $_ }) for @pidfiles;
98
99 unlink $sentinel;
100}
101
102foreach my $port ( map { $sb->port_for($_) } qw(node1 node2 node3) ) {
103 start_update_instance($port);
104}
105
106# #############################################################################
107# Basic cluster tests
108# #############################################################################
109
110my $rows = $node1->selectall_hashref("select * from test.heartbeat", 'server_id');
111
112is(
113 scalar keys %$rows,
114 3,
115 "Sanity check: All nodes are in the heartbeat table"
116);
117
118my $only_slave_data = {
119 map {
120 $_ => {
121 relay_master_log_file => $rows->{$_}->{relay_master_log_file},
122 exec_master_log_pos => $rows->{$_}->{exec_master_log_pos},
123 } } keys %$rows
124};
125
126my $same_data = { relay_master_log_file => undef, exec_master_log_pos => undef };
127is_deeply(
128 $only_slave_data,
129 {
130 12345 => $same_data,
131 12346 => $same_data,
132 12347 => $same_data,
133 },
134 "Sanity check: No slave data (relay log or master pos) is stored"
135);
136
137$output = output(sub{
138 pt_heartbeat::main($node1_dsn, qw(-D test --check)),
139 },
140 stderr => 1,
141);
142
143like(
144 $output,
145 qr/\QThe --master-server-id option must be specified because the heartbeat table `test`.`heartbeat`/,
146 "pt-heartbeat --check + PXC doesn't autodetect a master if there isn't any"
147);
148
149$output = output(sub{
150 pt_heartbeat::main($node1_dsn, qw(-D test --check),
151 '--master-server-id', $node3_port),
152 },
153 stderr => 1,
154);
155
156$output =~ s/\d\.\d{2}/0.00/g;
157is(
158 $output,
159 "0.00\n",
160 "pt-heartbeat --check + PXC works with --master-server-id"
161);
162
163# Test --monitor
164
165$output = output(sub {
166 pt_heartbeat::main($node1_dsn,
167 qw(-D test --monitor --run-time 1s),
168 '--master-server-id', $node3_port)
169 },
170 stderr => 1,
171);
172
173$output =~ s/\d\.\d{2}/0.00/g;
174is(
175 $output,
176 "0.00s [ 0.00s, 0.00s, 0.00s ]\n",
177 "--monitor works"
178);
179
180# Try to generate some lag between cluster nodes. Rather brittle at the moment.
181
182# Lifted from alter active table
183my $pt_osc_sample = "t/pt-online-schema-change/samples";
184
185my $query_table_stop = "/tmp/query_table.$PID.stop";
186my $query_table_pid = "/tmp/query_table.$PID.pid";
187my $query_table_output = "/tmp/query_table.$PID.output";
188
189$sb->create_dbs($node1, ['pt_osc']);
190$sb->load_file('master', "$pt_osc_sample/basic_no_fks_innodb.sql");
191
192$node1->do("USE pt_osc");
193$node1->do("TRUNCATE TABLE t");
194$node1->do("LOAD DATA INFILE '$trunk/$pt_osc_sample/basic_no_fks.data' INTO TABLE t");
195$node1->do("ANALYZE TABLE t");
196$sb->wait_for_slaves();
197
198diag(`rm -rf $query_table_stop`);
199diag(`echo > $query_table_output`);
200
201my $cmd = "$trunk/$pt_osc_sample/query_table.pl";
202system("$cmd 127.0.0.1 $node1_port pt_osc t id $query_table_stop $query_table_pid >$query_table_output 2>&1 &");
203wait_until(sub{-e $query_table_pid});
204
205# Reload sakila
206system "$trunk/sandbox/load-sakila-db $node1_port &";
207
208$output = output(sub {
209 pt_heartbeat::main($node3_dsn,
210 qw(-D test --monitor --run-time 5s),
211 '--master-server-id', $node1_port)
212 },
213 stderr => 1,
214);
215
216like(
217 $output,
218 qr/^(?:0\.(?:\d[1-9]|[1-9]\d)|\d*[1-9]\d*\.\d{2})s\s+\[/m,
219 "pt-heartbeat can detect replication lag between nodes"
220);
221
222diag(`touch $query_table_stop`);
223chomp(my $p = slurp_file($query_table_pid));
224wait_until(sub{!kill 0, $p});
225
226$node1->do(q{DROP DATABASE pt_osc});
227
228$sb->wait_for_slaves();
229
230# #############################################################################
231# cluster, node1 -> slave, run on node1
232# #############################################################################
233
234my ($slave_dbh, $slave_dsn) = $sb->start_sandbox(
235 server => 'cslave1',
236 type => 'slave',
237 master => 'node1',
238 env => q/BINLOG_FORMAT="ROW"/,
239);
240
241$sb->create_dbs($slave_dbh, ['test']);
242
243start_update_instance($sb->port_for('cslave1'));
244PerconaTest::wait_for_table($slave_dbh, "test.heartbeat", "1=1");
245
246$output = output(sub{
247 pt_heartbeat::main($slave_dsn, qw(-D test --check)),
248 },
249 stderr => 1,
250);
251
252like(
253 $output,
254 qr/\d\.\d{2}\n/,
255 "pt-heartbeat --check works on a slave of a cluster node"
256);
257
258$output = output(sub {
259 pt_heartbeat::main($slave_dsn,
260 qw(-D test --monitor --run-time 2s))
261 },
262 stderr => 1,
263);
264
265like(
266 $output,
267 qr/^\d.\d{2}s\s+\[/,
268 "pt-heartbeat --monitor + slave of a node1, without --master-server-id"
269);
270
271$output = output(sub {
272 pt_heartbeat::main($slave_dsn,
273 qw(-D test --monitor --run-time 2s),
274 '--master-server-id', $node3_port)
275 },
276 stderr => 1,
277);
278
279like(
280 $output,
281 qr/^\d.\d{2}s\s+\[/,
282 "pt-heartbeat --monitor + slave of node1, --master-server-id pointing to node3"
283);
284
285# #############################################################################
286# master -> node1 in cluster
287# #############################################################################
288
289# CAREFUL! See the comments in t/pt-table-checksum/pxc.t about cmaster.
290# Nearly everything applies here.
291
292my ($master_dbh, $master_dsn) = $sb->start_sandbox(
293 server => 'cmaster',
294 type => 'master',
295 env => q/BINLOG_FORMAT="ROW"/,
296);
297
298my $cmaster_port = $sb->port_for('cmaster');
299
300$sb->create_dbs($master_dbh, ['test']);
301
302$master_dbh->do("FLUSH LOGS");
303$master_dbh->do("RESET MASTER");
304
305$sb->set_as_slave('node1', 'cmaster');
306
307start_update_instance($sb->port_for('cmaster'));
308PerconaTest::wait_for_table($node1, "test.heartbeat", "server_id=$cmaster_port");
309
310$output = output(sub{
311 pt_heartbeat::main($node1_dsn, qw(-D test --check --print-master-server-id)),
312 },
313 stderr => 1,
314);
315
316like(
317 $output,
318 qr/^\d.\d{2} $cmaster_port$/,
319 "--print-master-id works for master -> $node1_port, when run from $node1_port"
320);
321
322# Wait until node2 & node3 get cmaster in their heartbeat tables
323$sb->wait_for_slaves(master => 'node1', slave => 'node2');
324$sb->wait_for_slaves(master => 'node1', slave => 'node3');
325
326foreach my $test (
327 [ $node2_port, $node2_dsn, $node2 ],
328 [ $node3_port, $node3_dsn, $node3 ],
329) {
330 my ($port, $dsn, $dbh) = @$test;
331
332 $output = output(sub{
333 pt_heartbeat::main($dsn, qw(-D test --check --print-master-server-id)),
334 },
335 stderr => 1,
336 );
337
338 # This could be made to work, see the node autodiscovery branch
339 TODO: {
340 local $::TODO = "cmaster -> node1, other nodes can't autodetect the master";
341 like(
342 $output,
343 qr/$cmaster_port/,
344 "--print-master-id works for master -> $node1_port, when run from $port"
345 );
346 }
347
348 $output = output(sub{
349 pt_heartbeat::main($dsn, qw(-D test --check --master-server-id), $cmaster_port),
350 },
351 stderr => 1,
352 );
353
354 $output =~ s/\d\.\d{2}/0.00/g;
355 is(
356 $output,
357 "0.00\n",
358 "--check + explicit --master-server-id work for master -> node1, run from $port"
359 );
360}
361
362# ############################################################################
363# Stop the --update instances.
364# ############################################################################
365
366stop_all_instances();
367
368# ############################################################################
369# Disconnect & stop the two servers we started
370# ############################################################################
371
372# We have to do this after the --stop, otherwise the --update processes will
373# spew a bunch of warnings and clog
374
375$slave_dbh->disconnect;
376$master_dbh->disconnect;
377$sb->stop_sandbox('cslave1', 'cmaster');
378$node1->do("STOP SLAVE");
379$node1->do("RESET SLAVE");
380
381# #############################################################################
382# Done.
383# #############################################################################
384$sb->wipe_clean($node1);
385diag(`/tmp/12345/stop`);
386diag(`/tmp/12345/start`);
387ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
388done_testing;
0389
=== modified file 't/pt-ioprofile/pt-ioprofile.t'
--- t/pt-ioprofile/pt-ioprofile.t 2012-07-23 15:17:37 +0000
+++ t/pt-ioprofile/pt-ioprofile.t 2012-12-20 23:20:32 +0000
@@ -19,24 +19,22 @@
19my $dp = new DSNParser(opts=>$dsn_opts);19my $dp = new DSNParser(opts=>$dsn_opts);
20my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);20my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
21my $dbh = $sb->get_dbh_for('master');21my $dbh = $sb->get_dbh_for('master');
22my $have_strace = `which strace 2>/dev/null`;
2223
23if ( !$dbh ) {24if ( !$dbh ) {
24 plan skip_all => "Cannot connect to master sandbox";25 plan skip_all => "Cannot connect to master sandbox";
25}26}
26else {27elsif ( !$have_strace ) {
27 plan tests => 5;28 plan skip_all => 'strace is not installed or not in PATH';
28}29}
2930
30my $output = "";31my $output = `$trunk/bin/pt-ioprofile --help 2>&1`;
31
32$output = `$trunk/bin/pt-ioprofile --help 2>&1`;
33like(32like(
34 $output,33 $output,
35 qr/--version/,34 qr/--version/,
36 "--help"35 "--help"
37);36);
3837
39
40my $t0 = time;38my $t0 = time;
41$output = `$trunk/bin/pt-ioprofile --run-time 3 2>&1`;39$output = `$trunk/bin/pt-ioprofile --run-time 3 2>&1`;
42my $t1 = time;40my $t1 = time;
@@ -47,17 +45,16 @@
47 "Runs without a file (bug 925778)"45 "Runs without a file (bug 925778)"
48);46);
4947
50TODO: {48# If the system is really slow, it may take a second to process the files
51 local $::TODO = "Timing-related test, may occasionally fail";49# and then clean up all the temp stuff. We'll give it a few seconds benefit
52 # If the system is really slow, it may take a second to process the files50# of the doubt.
53 # and then clean up all the temp stuff. We'll give it a few seconds benefit of the doubt.51cmp_ok(
54 cmp_ok(52 int($t1 - $t0),
55 int($t1 - $t0),53 '<=',
56 '<=',54 6,
57 6,55 "Runs for --run-time, more or less"
58 "Runs for --run-time, more or less"56);
59 );57
60}
61# #############################################################################58# #############################################################################
62# Short options.59# Short options.
63# #############################################################################60# #############################################################################
@@ -72,4 +69,4 @@
72# Done.69# Done.
73# #############################################################################70# #############################################################################
74ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");71ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
75exit;72done_testing;
7673
=== modified file 't/pt-kill/basics.t'
--- t/pt-kill/basics.t 2012-07-12 22:49:15 +0000
+++ t/pt-kill/basics.t 2012-12-20 23:20:32 +0000
@@ -35,7 +35,7 @@
3535
36# Shell out to a sleep(10) query and try to capture the query.36# Shell out to a sleep(10) query and try to capture the query.
37# Backticks don't work here.37# Backticks don't work here.
38system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5)' >/dev/null &");38system("/tmp/12345/use -e 'select sleep(5)' >/dev/null &");
3939
40$output = `$cmd --busy-time 1s --print --run-time 10`;40$output = `$cmd --busy-time 1s --print --run-time 10`;
4141
@@ -59,7 +59,7 @@
59# --iterations was 0, and another bug when --run-time was not respected.59# --iterations was 0, and another bug when --run-time was not respected.
60# Do it all over again, this time with --iterations 0.60# Do it all over again, this time with --iterations 0.
61# Re issue 1181, --iterations no longer exists, but we'll still keep this test.61# Re issue 1181, --iterations no longer exists, but we'll still keep this test.
62system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(10)' >/dev/null&");62system("/tmp/12345/use -e 'select sleep(10)' >/dev/null&");
63$output = `$cmd --busy-time 1s --print --run-time 11s`;63$output = `$cmd --busy-time 1s --print --run-time 11s`;
64@times = $output =~ m/\(Query (\d+) sec\)/g;64@times = $output =~ m/\(Query (\d+) sec\)/g;
65ok(65ok(
6666
=== modified file 't/pt-kill/kill.t'
--- t/pt-kill/kill.t 2012-12-04 21:05:32 +0000
+++ t/pt-kill/kill.t 2012-12-20 23:20:32 +0000
@@ -35,7 +35,7 @@
35# TODO: These tests need something to match, so we background35# TODO: These tests need something to match, so we background
36# a SLEEP(4) query and match that, but this isn't ideal because36# a SLEEP(4) query and match that, but this isn't ideal because
37# it's time-based. Better is to use a specific db and --match-db.37# it's time-based. Better is to use a specific db and --match-db.
38my $sys_cmd = "/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(4)' >/dev/null 2>&1 &";38my $sys_cmd = "/tmp/12345/use -e 'select sleep(4)' >/dev/null 2>&1 &";
3939
40# #############################################################################40# #############################################################################
41# Test that --kill kills the connection.41# Test that --kill kills the connection.
@@ -83,7 +83,7 @@
83# Here's how this works. This cmd is going to try 2 queries on the same83# Here's how this works. This cmd is going to try 2 queries on the same
84# connection: sleep5 and sleep3. --kill-query will kill sleep5 causing84# connection: sleep5 and sleep3. --kill-query will kill sleep5 causing
85# sleep3 to start using the same connection id (pid).85# sleep3 to start using the same connection id (pid).
86system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5); select sleep(3)' >/dev/null&");86system("/tmp/12345/use -e 'select sleep(5); select sleep(3)' >/dev/null&");
87sleep 0.5;87sleep 0.5;
88$rows = $dbh->selectall_hashref('show processlist', 'id');88$rows = $dbh->selectall_hashref('show processlist', 'id');
89$pid = 0; # reuse, reset89$pid = 0; # reuse, reset
9090
=== modified file 't/pt-mysql-summary/pt-mysql-summary.t'
--- t/pt-mysql-summary/pt-mysql-summary.t 2012-11-27 22:05:45 +0000
+++ t/pt-mysql-summary/pt-mysql-summary.t 2012-12-20 23:20:32 +0000
@@ -19,13 +19,18 @@
1919
20local $ENV{PTDEBUG} = "";20local $ENV{PTDEBUG} = "";
2121
22# mysqldump from earlier versions doesn't seem to work with 5.6,
23# so use the actual mysqldump from each MySQL bin which should
24# always be compatible with itself.
25my $env = qq\CMD_MYSQLDUMP="$ENV{PERCONA_TOOLKIT_SANDBOX}/bin/mysqldump"\;
26
22#27#
23# --save-samples28# --save-samples
24#29#
2530
26my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 );31my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 );
2732
28`$trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`;33`$env $trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
2934
30ok(35ok(
31 -e $dir,36 -e $dir,
@@ -41,13 +46,13 @@
41 "And leaves all files in there"46 "And leaves all files in there"
42) or diag($n_files, `ls -l $dir`);47) or diag($n_files, `ls -l $dir`);
4348
44undef($dir);49undef($dir); # rm the dir because CLEANUP => 1
4550
46#51#
47# --databases52# --databases
48#53#
4954
50my $out = `$trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`;55my $out = `$env $trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
5156
52like(57like(
53 $out,58 $out,
@@ -61,8 +66,7 @@
61 no_diff(66 no_diff(
62 sub {67 sub {
63 local $ENV{_NO_FALSE_NEGATIVES} = 1;68 local $ENV{_NO_FALSE_NEGATIVES} = 1;
64 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/'`;69 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/'`
65 print $out;
66 },70 },
67 "t/pt-mysql-summary/samples/expected_output_temp00$i.txt",71 "t/pt-mysql-summary/samples/expected_output_temp00$i.txt",
68 ),72 ),
@@ -82,4 +86,3 @@
82);86);
8387
84done_testing;88done_testing;
85exit;
8689
=== modified file 't/pt-online-schema-change/samples/bug_1045317.sql'
--- t/pt-online-schema-change/samples/bug_1045317.sql 2012-11-06 17:22:56 +0000
+++ t/pt-online-schema-change/samples/bug_1045317.sql 2012-12-20 23:20:32 +0000
@@ -6,5 +6,5 @@
6 `val` ENUM('M','E','H') NOT NULL,6 `val` ENUM('M','E','H') NOT NULL,
7 PRIMARY KEY (`id`)7 PRIMARY KEY (`id`)
8);8);
9
10INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H');9INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H');
10ANALYZE TABLE bits;
1111
=== modified file 't/pt-query-digest/explain.t'
--- t/pt-query-digest/explain.t 2012-11-21 16:58:40 +0000
+++ t/pt-query-digest/explain.t 2012-12-20 23:20:32 +0000
@@ -23,9 +23,6 @@
23if ( !$dbh ) {23if ( !$dbh ) {
24 plan skip_all => 'Cannot connect to sandbox master';24 plan skip_all => 'Cannot connect to sandbox master';
25}25}
26else {
27 plan tests => 6;
28}
2926
30my $sample = "t/pt-query-digest/samples/";27my $sample = "t/pt-query-digest/samples/";
3128
@@ -90,7 +87,6 @@
90 'Analysis for slow007 with --explain, failed',87 'Analysis for slow007 with --explain, failed',
91);88);
9289
93
94# #############################################################################90# #############################################################################
95# Issue 1196: mk-query-digest --explain is broken91# Issue 1196: mk-query-digest --explain is broken
96# #############################################################################92# #############################################################################
@@ -102,9 +98,9 @@
102 '--report-format', 'profile,query_report',98 '--report-format', 'profile,query_report',
103 "$trunk/t/pt-query-digest/samples/issue_1196.log",)99 "$trunk/t/pt-query-digest/samples/issue_1196.log",)
104 },100 },
105 ($sandbox_version ge '5.1'101 ( $sandbox_version eq '5.6' ? "$sample/issue_1196-output-5.6.txt"
106 ? "t/pt-query-digest/samples/issue_1196-output.txt"102 : $sandbox_version ge '5.1' ? "$sample/issue_1196-output.txt"
107 : "t/pt-query-digest/samples/issue_1196-output-5.0.txt"),103 : "$sample/issue_1196-output-5.0.txt"),
108 ),104 ),
109 "--explain sparkline uses event db and doesn't crash ea (issue 1196"105 "--explain sparkline uses event db and doesn't crash ea (issue 1196"
110);106);
@@ -114,4 +110,4 @@
114# #############################################################################110# #############################################################################
115$sb->wipe_clean($dbh);111$sb->wipe_clean($dbh);
116ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");112ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
117exit;113done_testing;
118114
=== added file 't/pt-query-digest/samples/issue_1196-output-5.6.txt'
--- t/pt-query-digest/samples/issue_1196-output-5.6.txt 1970-01-01 00:00:00 +0000
+++ t/pt-query-digest/samples/issue_1196-output-5.6.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,62 @@
1
2# Profile
3# Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item
4# ==== ================== ============= ===== ====== ==== ===== ======= ========
5# 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 1.00 0.00 TF>aa SELECT t
6
7# Query 1: 0 QPS, 0x concurrency, ID 0xD4B6A5CD2F2F485C at byte 0 ________
8# This item is included in the report because it matches --limit.
9# Scores: Apdex = 1.00 [1.0]*, V/M = 0.00
10# EXPLAIN sparkline: TF>aa
11# Query_time sparkline: | ^ |
12# Time range: all events occurred at 2010-12-14 16:12:28
13# Attribute pct total min max avg 95% stddev median
14# ============ === ======= ======= ======= ======= ======= ======= =======
15# Count 100 1
16# Exec time 100 215ms 215ms 215ms 215ms 215ms 0 215ms
17# Lock time 99 162us 162us 162us 162us 162us 0 162us
18# Rows sent 100 10 10 10 10 10 0 10
19# Rows examine 100 1.96k 1.96k 1.96k 1.96k 1.96k 0 1.96k
20# Query size 100 82 82 82 82 82 0 82
21# String:
22# Databases issue_1196
23# Hosts localhost
24# Users root
25# Query_time distribution
26# 1us
27# 10us
28# 100us
29# 1ms
30# 10ms
31# 100ms ################################################################
32# 1s
33# 10s+
34# Tables
35# SHOW TABLE STATUS FROM `issue_1196` LIKE 't'\G
36# SHOW CREATE TABLE `issue_1196`.`t`\G
37# EXPLAIN /*!50100 PARTITIONS*/
38select t.a, count(*) from t join t t2 using(a) group by 1 order by 2 desc limit 10\G
39# *************************** 1. row ***************************
40# id: 1
41# select_type: SIMPLE
42# table: t
43# partitions: NULL
44# type: ALL
45# possible_keys: NULL
46# key: NULL
47# key_len: NULL
48# ref: NULL
49# rows: 14
50# Extra: Using temporary; Using filesort
51# *************************** 2. row ***************************
52# id: 1
53# select_type: SIMPLE
54# table: t2
55# partitions: NULL
56# type: ALL
57# possible_keys: NULL
58# key: NULL
59# key_len: NULL
60# ref: NULL
61# rows: 14
62# Extra: Using where; Using join buffer (Block Nested Loop)
063
=== modified file 't/pt-table-checksum/basics.t'
--- t/pt-table-checksum/basics.t 2012-11-21 16:58:40 +0000
+++ t/pt-table-checksum/basics.t 2012-12-20 23:20:32 +0000
@@ -68,9 +68,7 @@
68ok(68ok(
69 no_diff(69 no_diff(
70 sub { pt_table_checksum::main(@args) },70 sub { pt_table_checksum::main(@args) },
71 $sandbox_version gt "5.1 " ? "$sample/default-results-5.5.txt"71 "$sample/default-results-$sandbox_version.txt",
72 : $sandbox_version gt "5.0 " ? "$sample/default-results-5.1.txt"
73 : "$sample/default-results-5.0.txt",
74 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'',72 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'',
75 ),73 ),
76 "Default checksum"74 "Default checksum"
@@ -93,29 +91,28 @@
93ok(91ok(
94 no_diff(92 no_diff(
95 sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) },93 sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) },
96 $sandbox_version gt "5.1" ? "$sample/static-chunk-size-results-5.5.txt"94 "$sample/static-chunk-size-results-$sandbox_version.txt",
97 : $sandbox_version gt "5.0" ? "$sample/static-chunk-size-results-5.1.txt"
98 : "$sample/static-chunk-size-results-5.0.txt",
99 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'',95 post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'',
100 ),96 ),
101 "Static chunk size (--chunk-time 0)"97 "Static chunk size (--chunk-time 0)"
102);98);
10399
100my $n_checksums = $sandbox_version eq "5.6" ? 89
101 : $sandbox_version eq "5.5" ? 90
102 : $sandbox_version eq "5.1" ? 89
103 : 85;
104
104$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");105$row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums");
105is(106is(
106 $row->[0],107 $row->[0],
107 ( $sandbox_version gt "5.1" ? 90108 $n_checksums,
108 : $sandbox_version gt "5.0" ? 89
109 : 85),
110 'Expected checksums on master'109 'Expected checksums on master'
111);110);
112111
113$row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums");112$row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums");
114is(113is(
115 $row->[0],114 $row->[0],
116 ( $sandbox_version gt "5.1" ? 90115 $n_checksums,
117 : $sandbox_version gt "5.0" ? 89
118 : 85),
119 'Expected checksums on slave'116 'Expected checksums on slave'
120);117);
121118
122119
=== modified file 't/pt-table-checksum/error_handling.t'
--- t/pt-table-checksum/error_handling.t 2012-11-21 16:58:40 +0000
+++ t/pt-table-checksum/error_handling.t 2012-12-20 23:20:32 +0000
@@ -178,8 +178,8 @@
178# Use the --replicate table created by the previous ^ tests.178# Use the --replicate table created by the previous ^ tests.
179179
180# Create a user that can't create the --replicate table.180# Create a user that can't create the --replicate table.
181diag(`/tmp/12345/use -uroot -pmsandbox < $trunk/t/lib/samples/ro-checksum-user.sql`);181diag(`/tmp/12345/use -uroot < $trunk/t/lib/samples/ro-checksum-user.sql`);
182diag(`/tmp/12345/use -uroot -pmsandbox -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`);182diag(`/tmp/12345/use -uroot -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`);
183183
184# Remove the --replicate table from slave1 and slave2,184# Remove the --replicate table from slave1 and slave2,
185# so it's only on the master...185# so it's only on the master...
@@ -199,7 +199,7 @@
199 "CREATE DATABASE error and db is missing on slaves (bug 1039569)"199 "CREATE DATABASE error and db is missing on slaves (bug 1039569)"
200);200);
201201
202diag(`/tmp/12345/use -uroot -pmsandbox -e "DROP USER ro_checksum_user\@'%'"`);202diag(`/tmp/12345/use -uroot -e "DROP USER ro_checksum_user\@'%'"`);
203203
204# #############################################################################204# #############################################################################
205# Done.205# Done.
206206
=== modified file 't/pt-table-checksum/issue_388.t'
--- t/pt-table-checksum/issue_388.t 2012-11-21 16:58:40 +0000
+++ t/pt-table-checksum/issue_388.t 2012-12-20 23:20:32 +0000
@@ -45,6 +45,7 @@
4545
46$output = output(46$output = output(
47 sub { pt_table_checksum::main(@args, qw(-d test)) },47 sub { pt_table_checksum::main(@args, qw(-d test)) },
48 stderr => 1,
48);49);
4950
50unlike(51unlike(
5152
=== modified file 't/pt-table-checksum/run_time.t'
--- t/pt-table-checksum/run_time.t 2012-11-21 16:58:40 +0000
+++ t/pt-table-checksum/run_time.t 2012-12-20 23:20:32 +0000
@@ -44,7 +44,7 @@
44my $t = time - $t0;44my $t = time - $t0;
4545
46ok(46ok(
47 $t >= 1.5 && $t <= 2.5,47 $t >= 1.1 && $t <= 2.5,
48 "Ran in roughly --run-time 1 second"48 "Ran in roughly --run-time 1 second"
49) or diag("Actual run time: $t");49) or diag("Actual run time: $t");
5050
5151
=== added file 't/pt-table-checksum/samples/default-results-5.6.txt'
--- t/pt-table-checksum/samples/default-results-5.6.txt 1970-01-01 00:00:00 +0000
+++ t/pt-table-checksum/samples/default-results-5.6.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,41 @@
1ERRORS DIFFS ROWS SKIPPED TABLE
20 0 0 0 mysql.columns_priv
30 0 2 0 mysql.db
40 0 0 0 mysql.event
50 0 0 0 mysql.func
60 0 39 0 mysql.help_category
70 0 461 0 mysql.help_keyword
80 0 1045 0 mysql.help_relation
90 0 324 0 mysql.help_topic
100 0 0 0 mysql.ndb_binlog_index
110 0 0 0 mysql.plugin
120 0 0 0 mysql.proc
130 0 0 0 mysql.procs_priv
140 0 2 0 mysql.proxies_priv
150 0 0 0 mysql.servers
160 0 0 0 mysql.tables_priv
170 0 0 0 mysql.time_zone
180 0 0 0 mysql.time_zone_leap_second
190 0 0 0 mysql.time_zone_name
200 0 0 0 mysql.time_zone_transition
210 0 0 0 mysql.time_zone_transition_type
220 0 2 0 mysql.user
230 0 42 0 percona_test.checksums
240 0 1 0 percona_test.load_data
250 0 1 0 percona_test.sentinel
260 0 200 0 sakila.actor
270 0 603 0 sakila.address
280 0 16 0 sakila.category
290 0 600 0 sakila.city
300 0 109 0 sakila.country
310 0 599 0 sakila.customer
320 0 1000 0 sakila.film
330 0 5462 0 sakila.film_actor
340 0 1000 0 sakila.film_category
350 0 1000 0 sakila.film_text
360 0 4581 0 sakila.inventory
370 0 6 0 sakila.language
380 0 16049 0 sakila.payment
390 0 16044 0 sakila.rental
400 0 2 0 sakila.staff
410 0 2 0 sakila.store
042
=== added file 't/pt-table-checksum/samples/repl-table-myisam.sql'
--- t/pt-table-checksum/samples/repl-table-myisam.sql 1970-01-01 00:00:00 +0000
+++ t/pt-table-checksum/samples/repl-table-myisam.sql 2012-12-20 23:20:32 +0000
@@ -0,0 +1,19 @@
1DROP DATABASE IF EXISTS percona;
2CREATE DATABASE percona;
3USE percona;
4CREATE TABLE checksums (
5 db char(64) NOT NULL,
6 tbl char(64) NOT NULL,
7 chunk int NOT NULL,
8 chunk_time float NULL,
9 chunk_index varchar(200) NULL,
10 lower_boundary text NULL,
11 upper_boundary text NULL,
12 this_crc char(40) NOT NULL,
13 this_cnt int NOT NULL,
14 master_crc char(40) NULL,
15 master_cnt int NULL,
16 ts timestamp NOT NULL,
17 PRIMARY KEY (db, tbl, chunk),
18 INDEX ts_db_tbl (ts, db, tbl)
19) ENGINE=MyISAM;
020
=== added file 't/pt-table-checksum/samples/static-chunk-size-results-5.6.txt'
--- t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 1970-01-01 00:00:00 +0000
+++ t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 2012-12-20 23:20:32 +0000
@@ -0,0 +1,41 @@
1ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE
20 0 0 1 0 mysql.columns_priv
30 0 2 1 0 mysql.db
40 0 0 1 0 mysql.event
50 0 0 1 0 mysql.func
60 0 39 1 0 mysql.help_category
70 0 461 1 0 mysql.help_keyword
80 0 1045 1 0 mysql.help_relation
90 0 324 1 0 mysql.help_topic
100 0 0 1 0 mysql.ndb_binlog_index
110 0 0 1 0 mysql.plugin
120 0 0 1 0 mysql.proc
130 0 0 1 0 mysql.procs_priv
140 0 2 1 0 mysql.proxies_priv
150 0 0 1 0 mysql.servers
160 0 0 1 0 mysql.tables_priv
170 0 0 1 0 mysql.time_zone
180 0 0 1 0 mysql.time_zone_leap_second
190 0 0 1 0 mysql.time_zone_name
200 0 0 1 0 mysql.time_zone_transition
210 0 0 1 0 mysql.time_zone_transition_type
220 0 2 1 0 mysql.user
230 0 42 1 0 percona_test.checksums
240 0 1 1 0 percona_test.load_data
250 0 1 1 0 percona_test.sentinel
260 0 200 1 0 sakila.actor
270 0 603 1 0 sakila.address
280 0 16 1 0 sakila.category
290 0 600 1 0 sakila.city
300 0 109 1 0 sakila.country
310 0 599 1 0 sakila.customer
320 0 1000 1 0 sakila.film
330 0 5462 8 0 sakila.film_actor
340 0 1000 1 0 sakila.film_category
350 0 1000 1 0 sakila.film_text
360 0 4581 7 0 sakila.inventory
370 0 6 1 0 sakila.language
380 0 16049 19 0 sakila.payment
390 0 16044 19 0 sakila.rental
400 0 2 1 0 sakila.staff
410 0 2 1 0 sakila.store
042
=== modified file 't/pt-table-checksum/skip_innodb.t'
--- t/pt-table-checksum/skip_innodb.t 2012-11-21 16:58:40 +0000
+++ t/pt-table-checksum/skip_innodb.t 2012-12-20 23:20:32 +0000
@@ -15,11 +15,12 @@
15use Sandbox;15use Sandbox;
16require "$trunk/bin/pt-table-checksum";16require "$trunk/bin/pt-table-checksum";
1717
18diag("Stopping/reconfiguring/restarting sandboxes 12348 and 12349");18if ( $sandbox_version eq '5.6' ) {
19diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);19 plan skip_all => 'http://bugs.mysql.com/67798';
20}
21
22diag(`$trunk/sandbox/stop-sandbox 12348 12349 >/dev/null`);
20diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`);23diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`);
21
22diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);
23diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox slave 12349 12348 >/dev/null`);24diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox slave 12349 12348 >/dev/null`);
2425
25my $dp = new DSNParser(opts=>$dsn_opts);26my $dp = new DSNParser(opts=>$dsn_opts);
@@ -33,9 +34,6 @@
33elsif ( !$slave_dbh ) {34elsif ( !$slave_dbh ) {
34 plan skip_all => 'Cannot connect to sandbox slave 12349';35 plan skip_all => 'Cannot connect to sandbox slave 12349';
35}36}
36else {
37 plan tests => 3;
38}
3937
40# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic38# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
41# so we need to specify --lock-wait-timeout=3 else the tool will die.39# so we need to specify --lock-wait-timeout=3 else the tool will die.
@@ -45,6 +43,26 @@
45my $output;43my $output;
46my $retval;44my $retval;
4745
46if ( $sandbox_version ge '5.6' ) {
47 # Before MySQL 5.6, even with the InnoDB engine off, creating an InnoDB
48 # table would simply result in:
49 #
50 # mysql> create table t (i int) engine=innodb;
51 # Query OK, 0 rows affected, 2 warnings (0.01 sec)
52 #
53 # mysql> show warnings;
54 # +---------+------+-------------------------------------------+
55 # | Level | Code | Message |
56 # +---------+------+-------------------------------------------+
57 # | Warning | 1286 | Unknown table engine 'innodb' |
58 # | Warning | 1266 | Using storage engine MyISAM for table 't' |
59 # +---------+------+-------------------------------------------+
60 #
61 # But 5.6 throws an error. So we have to create the table manually.
62 $sb->load_file('master1', "t/pt-table-checksum/samples/repl-table-myisam.sql");
63 $sb->wait_for_slaves(master => 'master1', slave => 'master2');
64}
65
48$output = output(66$output = output(
49 sub { $retval = pt_table_checksum::main(@args) },67 sub { $retval = pt_table_checksum::main(@args) },
50 stderr => 1,68 stderr => 1,
@@ -60,13 +78,12 @@
60 $retval,78 $retval,
61 0,79 0,
62 "0 exit status (bug 996110)"80 "0 exit status (bug 996110)"
63);81) or diag($output);
6482
65# #############################################################################83# #############################################################################
66# Done.84# Done.
67# #############################################################################85# #############################################################################
68diag('Shutting down sandboxes');86$sb->wipe_clean($master_dbh);
69diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);87diag(`$trunk/sandbox/stop-sandbox 12349 12348 >/dev/null`);
70diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`);
71ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");88ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
72exit;89done_testing;
7390
=== modified file 't/pt-table-sync/basics.t'
--- t/pt-table-sync/basics.t 2012-06-07 14:25:44 +0000
+++ t/pt-table-sync/basics.t 2012-12-20 23:20:32 +0000
@@ -188,7 +188,7 @@
188188
189like(189like(
190 $output,190 $output,
191 qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 04:34:33'\)/,191 qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 11:34:33'\)/,
192 "--replicate with char index col (bug 911996)"192 "--replicate with char index col (bug 911996)"
193);193);
194194
195195
=== modified file 't/pt-upgrade/warnings.t'
--- t/pt-upgrade/warnings.t 2012-10-17 22:19:44 +0000
+++ t/pt-upgrade/warnings.t 2012-12-20 23:20:32 +0000
@@ -15,38 +15,36 @@
15use Sandbox;15use Sandbox;
16require "$trunk/bin/pt-upgrade";16require "$trunk/bin/pt-upgrade";
1717
18# This runs immediately if the server is already running, else it starts it.18diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`);
19diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`);19diag(`QUERY_CACHE_SIZE=1048576 $trunk/sandbox/start-sandbox master 12349 >/dev/null`);
2020
21my $dp = new DSNParser(opts=>$dsn_opts);21my $dp = new DSNParser(opts=>$dsn_opts);
22my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);22my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
23my $dbh1 = $sb->get_dbh_for('master');23my $dbh1 = $sb->get_dbh_for('master');
24my $dbh2 = $sb->get_dbh_for('master1');24my $dbh2 = $sb->get_dbh_for('master2');
2525
26if ( !$dbh1 ) {26if ( !$dbh1 ) {
27 diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);
28 plan skip_all => 'Cannot connect to sandbox master';27 plan skip_all => 'Cannot connect to sandbox master';
29}28}
30elsif ( !$dbh2 ) {29elsif ( !$dbh2 ) {
31 diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);30 diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`);
32 plan skip_all => 'Cannot connect to second sandbox master';31 plan skip_all => 'Cannot connect to second sandbox master';
33}32}
3433
35$sb->load_file('master', 't/pt-upgrade/samples/001/tables.sql');34$sb->load_file('master', 't/pt-upgrade/samples/001/tables.sql');
36$sb->load_file('master1', 't/pt-upgrade/samples/001/tables.sql');35$sb->load_file('master2', 't/pt-upgrade/samples/001/tables.sql');
3736
38my $output;37my $output;
39my $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";38my $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";
4039
41# This test really deals with,40# This test really deals with,
42# http://code.google.com/p/maatkit/issues/detail?id=75441# http://code.google.com/p/maatkit/issues/detail?id=754
43# http://bugs.mysql.com/bug.php?id=4963442# http://bugs.mysql.com/bug.php?id=49634
4443
45$dbh2->do('set global query_cache_size=1000000');
46
47my $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1];44my $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1];
48ok(45is(
49 $qc > 999000,46 $qc,
47 1048576,
50 'Query size'48 'Query size'
51);49);
5250
@@ -62,7 +60,7 @@
62$output = `$cmd $trunk/t/pt-upgrade/samples/001/one-error.log`;60$output = `$cmd $trunk/t/pt-upgrade/samples/001/one-error.log`;
63like(61like(
64 $output,62 $output,
65 qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,63 qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
66 '--clear-warnings',64 '--clear-warnings',
67);65);
6866
@@ -78,22 +76,15 @@
78$output = `$cmd --no-clear-warnings $trunk/t/pt-upgrade/samples/001/one-error.log`;76$output = `$cmd --no-clear-warnings $trunk/t/pt-upgrade/samples/001/one-error.log`;
79like(77like(
80 $output,78 $output,
81 qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,79 qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/,
82 '--no-clear-warnings'80 '--no-clear-warnings'
83);81);
8482
85$dbh2->do('set global query_cache_size=0');
86$qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1];
87ok(
88 $qc == 0,
89 'Query size'
90);
91
92# #############################################################################83# #############################################################################
93# Done.84# Done.
94# #############################################################################85# #############################################################################
86diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`);
95$sb->wipe_clean($dbh1);87$sb->wipe_clean($dbh1);
96diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`);
97ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");88ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
98done_testing;89done_testing;
99exit;90exit;

Subscribers

People subscribed via source and target branches