mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Merge changes.
This commit is contained in:
@@ -1719,7 +1719,7 @@ sub main {
|
|||||||
|
|
||||||
if ( $o->get('separate') ) { # List each grant separately.
|
if ( $o->get('separate') ) { # List each grant separately.
|
||||||
@grants = map {
|
@grants = map {
|
||||||
my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON ((?:`|\*).*)$/;
|
my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON (.*)$/;
|
||||||
map { "GRANT $_ ON $on_what" } split(', ', $grants);
|
map { "GRANT $_ ON $on_what" } split(', ', $grants);
|
||||||
} @grants;
|
} @grants;
|
||||||
my $count;
|
my $count;
|
||||||
@@ -1753,16 +1753,10 @@ sub main {
|
|||||||
my $grant = $_;
|
my $grant = $_;
|
||||||
PTDEBUG && _d($grant);
|
PTDEBUG && _d($grant);
|
||||||
my ( $grants, $on_what, $user ) = $grant
|
my ( $grants, $on_what, $user ) = $grant
|
||||||
=~ m/GRANT (.*?) ON ((?:`|\*).*?) TO ('[^']*'\@'[^']+')?/;
|
=~ m/GRANT (.*?) ON (.*?) TO ('[^']*'\@'[^']*')/;
|
||||||
PTDEBUG && _d('grants:', $grants, 'on_what:', $on_what,
|
PTDEBUG && _d('grants:', $grants, 'on_what:', $on_what,
|
||||||
'user:', $user);
|
'user:', $user);
|
||||||
|
|
||||||
if ( !$user ) {
|
|
||||||
# Anonymous user: ''@'' (issue 445).
|
|
||||||
PTDEBUG && _d('Anonymous user');
|
|
||||||
$user = "''\@''";
|
|
||||||
}
|
|
||||||
|
|
||||||
my @result;
|
my @result;
|
||||||
if ( $o->get('separate') ) {
|
if ( $o->get('separate') ) {
|
||||||
@result = map { "REVOKE $_ ON $on_what FROM $user" }
|
@result = map { "REVOKE $_ ON $on_what FROM $user" }
|
||||||
|
@@ -194,11 +194,17 @@ SKIP: {
|
|||||||
. "]";
|
. "]";
|
||||||
$flat_string =~ s/\n/\\n/g;
|
$flat_string =~ s/\n/\\n/g;
|
||||||
|
|
||||||
is_deeply(
|
# diag($test_index);
|
||||||
[ $q->deserialize_list($selsth->fetchrow_array()) ],
|
SKIP: {
|
||||||
$serialize_tests[$test_index],
|
skip "DBD::mysql version $DBD::mysql::VERSION has utf8 bugs. "
|
||||||
"Serialize $flat_string"
|
. "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();
|
$sth->finish();
|
||||||
|
@@ -22,6 +22,10 @@ my $dbh = $sb->get_dbh_for('master');
|
|||||||
if ( !$dbh ) {
|
if ( !$dbh ) {
|
||||||
plan skip_all => 'Cannot connect to sandbox master';
|
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 {
|
else {
|
||||||
plan tests => 3;
|
plan tests => 3;
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
use test;
|
use test;
|
||||||
drop table if exists stat_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`;
|
||||||
DROP TABLE IF EXISTS `table_5_dest`;
|
DROP TABLE IF EXISTS `table_5_dest`;
|
||||||
DROP TABLE IF EXISTS `table_5_copy`;
|
DROP TABLE IF EXISTS `table_5_copy`;
|
||||||
|
@@ -23,7 +23,7 @@ if ( !$dbh1 ) {
|
|||||||
plan skip_all => 'Cannot connect to sandbox master';
|
plan skip_all => 'Cannot connect to sandbox master';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plan tests => 11;
|
plan tests => 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $output;
|
my $output;
|
||||||
|
@@ -23,7 +23,7 @@ if ( !$dbh ) {
|
|||||||
plan skip_all => 'Cannot connect to sandbox master';
|
plan skip_all => 'Cannot connect to sandbox master';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plan tests => 4;
|
plan tests => 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
@@ -78,10 +78,11 @@ my $all_sakila_tables = [
|
|||||||
# ############################################################################
|
# ############################################################################
|
||||||
|
|
||||||
$output = output(
|
$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');
|
$row = $master_dbh->selectall_arrayref('select db, tbl from percona.checksums order by db, tbl');
|
||||||
|
|
||||||
is_deeply(
|
is_deeply(
|
||||||
$row,
|
$row,
|
||||||
$all_sakila_tables,
|
$all_sakila_tables,
|
||||||
@@ -131,7 +132,7 @@ is_deeply(
|
|||||||
);
|
);
|
||||||
|
|
||||||
$output = output(
|
$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');
|
$row = $master_dbh->selectall_arrayref('select db, tbl from percona.checksums order by db, tbl');
|
||||||
|
Reference in New Issue
Block a user