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

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

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

506. By Brian Fraser

Merged pxc-pt-heartbeat

507. By Brian Fraser

Merged fix-886059-pt-heartbeat-timezones

508. By Brian Fraser

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

509. By Daniel Nichter

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

510. By Daniel Nichter

Fix two possible sources of test errors.

511. By Daniel Nichter

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

512. By Daniel Nichter

Add REFETCH_MYSQL to jenkins-test.

513. By Daniel Nichter

Fix REFETCH_MYSQL.

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

Merged mysql-5.6-test-fixes and resolved conflicts

515. By Brian Fraser

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

516. By Brian Fraser

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

517. By Brian Fraser

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

518. By Brian Fraser

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

519. By Brian Fraser

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

520. By Daniel Nichter

Merge 2.1 r514, just a doc change.

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

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

522. By Daniel Nichter

Update SchemaIterator.t sample files.

523. By Daniel Nichter

Make timing test more reasonable on fast systems.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-deadlock-logger'
--- bin/pt-deadlock-logger 2012-12-14 01:47:50 +0000
+++ bin/pt-deadlock-logger 2012-12-20 23:20:29 +0000
@@ -3759,7 +3759,7 @@
3759my $n = qr/([^`\s]+)/; # MySQL object name3759my $n = qr/([^`\s]+)/; # MySQL object name
3760my $u = qr/(\S+)/; # Username. This is somewhat wrong, but3760my $u = qr/(\S+)/; # Username. This is somewhat wrong, but
3761 # usernames with spaces are rare enough.3761 # usernames with spaces are rare enough.
3762my $s = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp3762my $s = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)(?: [A-Fa-f0-9]+)?/; # InnoDB timestamp
37633763
3764# 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
3765# source. Fortunately, most of them begin with a gerunded verb. These are3765# source. Fortunately, most of them begin with a gerunded verb. These are
@@ -4140,8 +4140,11 @@
41404140
4141 # Extract some miscellaneous data from the deadlock.4141 # Extract some miscellaneous data from the deadlock.
4142 my ( $ts ) = $dl_text =~ m/^$s$/m;4142 my ( $ts ) = $dl_text =~ m/^$s$/m;
4143 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+)$/;
4144 $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);
4145 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;4148 my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m;
4146 $victim ||= 0;4149 $victim ||= 0;
41474150
41484151
=== 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:29 +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:29 +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-index-usage'
--- bin/pt-index-usage 2012-12-03 03:48:11 +0000
+++ bin/pt-index-usage 2012-12-20 23:20:29 +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-mysql-summary'
--- bin/pt-mysql-summary 2012-12-06 00:10:22 +0000
+++ bin/pt-mysql-summary 2012-12-20 23:20:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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/servers/5.6/data.tar.gz'
200Binary files sandbox/servers/5.6/data.tar.gz 2012-10-16 15:13:19 +0000 and sandbox/servers/5.6/data.tar.gz 2012-12-20 23:20:29 +0000 differ204Binary files sandbox/servers/5.6/data.tar.gz 2012-10-16 15:13:19 +0000 and sandbox/servers/5.6/data.tar.gz 2012-12-20 23:20:29 +0000 differ
=== modified file 'sandbox/start-sandbox'
--- sandbox/start-sandbox 2012-12-11 21:43:45 +0000
+++ sandbox/start-sandbox 2012-12-20 23:20:29 +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
@@ -89,6 +89,9 @@
89 if [ -n "$SKIP_INNODB" ]; then89 if [ -n "$SKIP_INNODB" ]; then
90 echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf90 echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf
91 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
92 fi95 fi
93 if [ -n "$MODE_ANSI" ]; then96 if [ -n "$MODE_ANSI" ]; then
94 echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf97 echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf
@@ -99,6 +102,10 @@
99 if [ -n "$LOCAL_INFILE" ]; then102 if [ -n "$LOCAL_INFILE" ]; then
100 echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf103 echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf
101 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
102109
103 # If the sandbox is a slave, set it read_only.110 # If the sandbox is a slave, set it read_only.
104 if [ "$type" = "slave" ]; then111 if [ "$type" = "slave" ]; then
@@ -116,13 +123,21 @@
116 debug_sandbox $port123 debug_sandbox $port
117 exit 1124 exit 1
118 fi125 fi
126
127 for sql in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/"*.sql; do
128 [ -f "$sql" ] && /tmp/$port/use < $sql
129 done
119 fi130 fi
120 else131 else
121 echo "Sandbox $type $port failed to start." >&2132 echo "Sandbox $type $port failed to start." >&2
122 debug_sandbox $port133 debug_sandbox $port
123 exit 1134 exit 1
124 fi135 fi
125 136
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
126 # If the sandbox is a slave, start the slave.141 # If the sandbox is a slave, start the slave.
127 if [ "$type" = "slave" ]; then142 if [ "$type" = "slave" ]; then
128 /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"
129144
=== modified file 'sandbox/test-env'
--- sandbox/test-env 2012-12-11 21:43:45 +0000
+++ sandbox/test-env 2012-12-20 23:20:29 +0000
@@ -334,11 +334,10 @@
334 ../util/check-load-data334 ../util/check-load-data
335335
336 ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")336 ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())")
337 /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";
338 /tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')";
339 echo -n "Waiting for replication to finish..."338 echo -n "Waiting for replication to finish..."
340 for i in $(_seq 60); do339 for i in $(_seq 60); do
341 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)
342 [ "$ping" = "$pong" ] && break341 [ "$ping" = "$pong" ] && break
343 echo -n '.'342 echo -n '.'
344 sleep 1343 sleep 1
345344
=== 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:29 +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:29 +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:29 +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:29 +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
=== 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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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
=== 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:29 +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
=== modified file 't/pt-heartbeat/bugs.t'
--- t/pt-heartbeat/bugs.t 2012-12-13 16:20:48 +0000
+++ t/pt-heartbeat/bugs.t 2012-12-20 23:20:29 +0000
@@ -84,6 +84,8 @@
8484
85start_update_instance( $master_port );85start_update_instance( $master_port );
8686
87PerconaTest::wait_for_table($slave1_dbh, 'test.heartbeat', 'server_id=12345');
88
87my $slave1_dsn = $sb->dsn_for('slave1');89my $slave1_dsn = $sb->dsn_for('slave1');
88# Using full_output here to work around a Perl bug: Only the first explicit90# Using full_output here to work around a Perl bug: Only the first explicit
89# tzset works.91# tzset works.
9092
=== 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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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/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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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:29 +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