diff --git a/bin/pt-show-grants b/bin/pt-show-grants index 779c1eac..728de15d 100755 --- a/bin/pt-show-grants +++ b/bin/pt-show-grants @@ -1719,7 +1719,7 @@ sub main { if ( $o->get('separate') ) { # List each grant separately. @grants = map { - my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON ((?:`|\*).*)$/; + my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON (.*)$/; map { "GRANT $_ ON $on_what" } split(', ', $grants); } @grants; my $count; @@ -1753,16 +1753,10 @@ sub main { my $grant = $_; PTDEBUG && _d($grant); my ( $grants, $on_what, $user ) = $grant - =~ m/GRANT (.*?) ON ((?:`|\*).*?) TO ('[^']*'\@'[^']+')?/; + =~ m/GRANT (.*?) ON (.*?) TO ('[^']*'\@'[^']*')/; PTDEBUG && _d('grants:', $grants, 'on_what:', $on_what, 'user:', $user); - if ( !$user ) { - # Anonymous user: ''@'' (issue 445). - PTDEBUG && _d('Anonymous user'); - $user = "''\@''"; - } - my @result; if ( $o->get('separate') ) { @result = map { "REVOKE $_ ON $on_what FROM $user" } diff --git a/t/lib/Quoter.t b/t/lib/Quoter.t index 2c742f37..e9d4866a 100644 --- a/t/lib/Quoter.t +++ b/t/lib/Quoter.t @@ -194,11 +194,17 @@ SKIP: { . "]"; $flat_string =~ s/\n/\\n/g; - is_deeply( - [ $q->deserialize_list($selsth->fetchrow_array()) ], - $serialize_tests[$test_index], - "Serialize $flat_string" - ); + # diag($test_index); + SKIP: { + skip "DBD::mysql version $DBD::mysql::VERSION has utf8 bugs. " + . "See https://bugs.launchpad.net/percona-toolkit/+bug/932327", + 1 if $DBD::mysql::VERSION lt '4' && $test_index == 9; + is_deeply( + [ $q->deserialize_list($selsth->fetchrow_array()) ], + $serialize_tests[$test_index], + "Serialize $flat_string" + ); + } } $sth->finish(); diff --git a/t/pt-archiver/issue_1229.t b/t/pt-archiver/issue_1229.t index 277144e7..cb47f23c 100644 --- a/t/pt-archiver/issue_1229.t +++ b/t/pt-archiver/issue_1229.t @@ -22,6 +22,10 @@ my $dbh = $sb->get_dbh_for('master'); if ( !$dbh ) { plan skip_all => 'Cannot connect to sandbox master'; } +elsif ( $DBD::mysql::VERSION lt '4' ) { + plan skip_all => "DBD::mysql version $DBD::mysql::VERSION has utf8 bugs. " + . "See https://bugs.launchpad.net/percona-toolkit/+bug/932327"; +} else { plan tests => 3; } diff --git a/t/pt-archiver/samples/table5.sql b/t/pt-archiver/samples/table5.sql index 15ce120f..6710b73a 100644 --- a/t/pt-archiver/samples/table5.sql +++ b/t/pt-archiver/samples/table5.sql @@ -1,6 +1,6 @@ use test; drop table if exists stat_test; -create table stat_test(a int); +create table stat_test(a int)engine=myisam; -- required b/c test plugin does not commit txn DROP TABLE IF EXISTS `table_5`; DROP TABLE IF EXISTS `table_5_dest`; DROP TABLE IF EXISTS `table_5_copy`; diff --git a/t/pt-deadlock-logger/standard_options.t b/t/pt-deadlock-logger/standard_options.t index cb360c7a..6058ffe0 100644 --- a/t/pt-deadlock-logger/standard_options.t +++ b/t/pt-deadlock-logger/standard_options.t @@ -23,7 +23,7 @@ if ( !$dbh1 ) { plan skip_all => 'Cannot connect to sandbox master'; } else { - plan tests => 11; + plan tests => 10; } my $output; diff --git a/t/pt-log-player/issue_903.t b/t/pt-log-player/issue_903.t index ceeccd53..5ec1b138 100644 --- a/t/pt-log-player/issue_903.t +++ b/t/pt-log-player/issue_903.t @@ -23,7 +23,7 @@ if ( !$dbh ) { plan skip_all => 'Cannot connect to sandbox master'; } else { - plan tests => 4; + plan tests => 3; } # ############################################################################# diff --git a/t/pt-table-checksum/resume.t b/t/pt-table-checksum/resume.t index 9979bcd4..a7df0803 100644 --- a/t/pt-table-checksum/resume.t +++ b/t/pt-table-checksum/resume.t @@ -78,10 +78,11 @@ my $all_sakila_tables = [ # ############################################################################ $output = output( - sub { pt_table_checksum::main(@args, qw(-d sakila --resume)) }, + sub { pt_table_checksum::main(@args, qw(-d sakila --resume --chunk-size 10000)) }, ); $row = $master_dbh->selectall_arrayref('select db, tbl from percona.checksums order by db, tbl'); + is_deeply( $row, $all_sakila_tables, @@ -131,7 +132,7 @@ is_deeply( ); $output = output( - sub { pt_table_checksum::main(@args, qw(-d sakila --resume)) }, + sub { pt_table_checksum::main(@args, qw(-d sakila --resume --chunk-size 10000)) }, ); $row = $master_dbh->selectall_arrayref('select db, tbl from percona.checksums order by db, tbl');