Merge changes.

This commit is contained in:
Daniel Nichter
2012-06-04 07:34:07 -07:00
7 changed files with 23 additions and 18 deletions

View File

@@ -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" }

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -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`;

View File

@@ -23,7 +23,7 @@ if ( !$dbh1 ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 11;
plan tests => 10;
}
my $output;

View File

@@ -23,7 +23,7 @@ if ( !$dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
else {
plan tests => 4;
plan tests => 3;
}
# #############################################################################

View File

@@ -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');