mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
Merge changes.
This commit is contained in:
@@ -42,7 +42,7 @@ use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
eval {
|
||||
require IO::Uncompress::Inflate;
|
||||
require IO::Uncompress::Inflate; # yum: perl-IO-Compress-Zlib
|
||||
IO::Uncompress::Inflate->import(qw(inflate $InflateError));
|
||||
};
|
||||
|
||||
|
@@ -28,7 +28,7 @@ use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
eval {
|
||||
require IO::Uncompress::Inflate;
|
||||
require IO::Uncompress::Inflate; # yum: perl-IO-Compress-Zlib
|
||||
IO::Uncompress::Inflate->import(qw(inflate $InflateError));
|
||||
};
|
||||
|
||||
|
@@ -158,6 +158,14 @@ sub _check_server {
|
||||
|
||||
sub wipe_clean {
|
||||
my ( $self, $dbh ) = @_;
|
||||
# If any other connections to the server are holding metadata locks, then
|
||||
# the DROP commands will just hang forever.
|
||||
my @cxns = @{$dbh->selectall_arrayref('SHOW FULL PROCESSLIST', {Slice => {}})};
|
||||
foreach my $cxn ( @cxns ) {
|
||||
if ( $cxn->{user} eq 'msandbox' && $cxn->{command} eq 'Sleep' ) {
|
||||
$dbh->do("KILL $cxn->{id}");
|
||||
}
|
||||
}
|
||||
foreach my $db ( @{$dbh->selectcol_arrayref('SHOW DATABASES')} ) {
|
||||
next if $db eq 'mysql';
|
||||
next if $db eq 'information_schema';
|
||||
|
@@ -11,10 +11,8 @@ die() {
|
||||
|
||||
make_sandbox() {
|
||||
# Make the sandbox dir and extract the base files.
|
||||
mkdir /tmp/$port
|
||||
if [ $? -ne 0 ]; then
|
||||
die "mkdir /tmp/$port failed"
|
||||
fi
|
||||
rm -rf /tmp/$port || die "can't rm /tmp/$port"
|
||||
mkdir /tmp/$port || die "mkdir /tmp/$port failed"
|
||||
cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port
|
||||
tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port
|
||||
|
||||
|
@@ -337,7 +337,7 @@ ok($res->{result} >= 0, 'Wait was successful');
|
||||
|
||||
$ms->stop_slave($slaves[0]);
|
||||
$dbh->do('drop database if exists test'); # Any stmt will do
|
||||
diag(`(sleep 1; echo "start slave" | /tmp/$port_for{slave0}/use)&`);
|
||||
diag(`(sleep 3; echo "start slave" | /tmp/$port_for{slave0}/use)&`);
|
||||
eval {
|
||||
$res = $ms->wait_for_master(
|
||||
master_status => $ms->get_master_status($dbh),
|
||||
|
@@ -78,9 +78,11 @@ is_deeply(
|
||||
# Test online stuff, e.g. get_cols_and_struct().
|
||||
# #############################################################################
|
||||
use DSNParser;
|
||||
use VersionParser;
|
||||
use Sandbox;
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $vp = new VersionParser;
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
|
||||
SKIP: {
|
||||
@@ -170,7 +172,7 @@ SKIP: {
|
||||
id => undef,
|
||||
i => undef,
|
||||
f => undef,
|
||||
d => undef,
|
||||
d => ($vp->version_ge($dbh, '5.5.1') ? '(7)' : undef),
|
||||
dt => undef,
|
||||
ts => undef,
|
||||
c => '(1)',
|
||||
|
@@ -130,7 +130,8 @@ SKIP: {
|
||||
# Test simple, unfiltered get_db_itr().
|
||||
# ########################################################################
|
||||
test_so(
|
||||
result => $sandbox_version ge '5.1' ? "$out/all-dbs-tbls.txt"
|
||||
result => $sandbox_version ge '5.5' ? "$out/all-dbs-tbls.txt"
|
||||
: $sandbox_version ge '5.1' ? "$out/all-dbs-tbls-5.1.txt"
|
||||
: "$out/all-dbs-tbls-5.0.txt",
|
||||
test_name => "Iterate all schema objects with dbh",
|
||||
);
|
||||
@@ -190,7 +191,7 @@ SKIP: {
|
||||
# Filter by engines. This also tests that --engines is case-insensitive
|
||||
test_so(
|
||||
filters => ['-d', 'd1,d2,d3', '--engines', 'INNODB'],
|
||||
result => "d1.t2 ",
|
||||
result => ($sandbox_version ge '5.5' ? 'd1.t2 d2.t1 ' : "d1.t2 "),
|
||||
test_name => '--engines',
|
||||
);
|
||||
|
||||
|
@@ -31,6 +31,7 @@ CREATE TABLE `user` (
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
@@ -39,6 +40,8 @@ CREATE TABLE `user` (
|
||||
`max_updates` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`max_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
|
||||
`plugin` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`authentication_string` text COLLATE utf8_bin NOT NULL,
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
|
||||
|
||||
|
@@ -23,7 +23,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 4;
|
||||
plan tests => 3;
|
||||
}
|
||||
|
||||
# #############################################################################
|
||||
|
@@ -23,7 +23,7 @@ if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
}
|
||||
else {
|
||||
plan tests => 21;
|
||||
plan tests => 20;
|
||||
}
|
||||
|
||||
my $output;
|
||||
|
@@ -11,4 +11,4 @@ CREATE TABLE `messages` (
|
||||
PRIMARY KEY (`MID`),
|
||||
UNIQUE KEY `ID` (`MID`),
|
||||
KEY `TID` (`TID`)
|
||||
) TYPE=MyISAM;
|
||||
) ENGINE=MyISAM;
|
||||
|
Reference in New Issue
Block a user