mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-24 05:15:02 +00:00
PT-2340 - Support MySQL 8.4
- Removed runtime.txt after discussion with Anastasia Alexandrova - Added "use VersionParser" into tests in t/lib when needed - Removed word master from tests for pt-archiver, pt-config-diff, pt-deadlock-logger, pt-duplicate-key-checker, pt-find, pt-fk-error-logger, pt-heartbeat, pt-index-usage, pt-ioprofile, pt-kill, pt-mysql-summary - Removed word slave from tests for pt-archiver, pt-config-diff, pt-deadlock-logger, pt-duplicate-key-checker, pt-find, pt-fk-error-logger, pt-heartbeat, pt-index-usage, pt-ioprofile, pt-kill, pt-mysql-summary - Updated modules for pt-archiver, pt-config-diff, pt-deadlock-logger, pt-duplicate-key-checker, pt-find, pt-fk-error-logger, pt-heartbeat, pt-index-usage, pt-ioprofile, pt-kill, pt-mysql-summary - Changed mysql_ssl patch, so it is now short option s - Added a check for existing zombies in t/pt-kill/execute_command.t - Added bin/pt-galera-log-explainer to .gitignore
This commit is contained in:
@@ -20,10 +20,10 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $master_dbh = $sb->get_dbh_for('master');
|
||||
my $source_dbh = $sb->get_dbh_for('source');
|
||||
|
||||
if ( !$master_dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
if ( !$source_dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 3;
|
||||
@@ -72,6 +72,6 @@ diag(`cp $cnf.bak $cnf`);
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
$sb->wipe_clean($master_dbh);
|
||||
$sb->wipe_clean($source_dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
exit;
|
||||
|
@@ -19,11 +19,11 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
my $dbh = $sb->get_dbh_for('source');
|
||||
my $has_keyring_plugin;
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 3;
|
||||
|
@@ -19,19 +19,19 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
my $dbh = $sb->get_dbh_for('source');
|
||||
my $cnf = '/tmp/12345/my.sandbox.cnf';
|
||||
my $output;
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 5;
|
||||
}
|
||||
|
||||
$sb->do_as_root("master", q/create user pt2302 identified by "root_'f<=*password"/);
|
||||
$sb->do_as_root("master", q/grant all on *.* to pt2302/);
|
||||
$sb->do_as_root("source", q/create user pt2302 identified by "root_'f<=*password"/);
|
||||
$sb->do_as_root("source", q/grant all on *.* to pt2302/);
|
||||
|
||||
my $cmd = "$trunk/bin/pt-mysql-summary --sleep 1 -- --defaults-file=$cnf --user=pt2302 --password=\"root_'f<=*password\"";
|
||||
|
||||
@@ -49,9 +49,9 @@ unlike(
|
||||
"pt-mysql-summary works fine with password containing an apostrophe"
|
||||
);
|
||||
|
||||
$sb->do_as_root("master", q/drop user pt2302/);
|
||||
$sb->do_as_root("master", q/create user pt2302 identified by 'root_"f<=*password'/);
|
||||
$sb->do_as_root("master", q/grant all on *.* to pt2302/);
|
||||
$sb->do_as_root("source", q/drop user pt2302/);
|
||||
$sb->do_as_root("source", q/create user pt2302 identified by 'root_"f<=*password'/);
|
||||
$sb->do_as_root("source", q/grant all on *.* to pt2302/);
|
||||
|
||||
$cmd = "$trunk/bin/pt-mysql-summary --sleep 1 -- --defaults-file=$cnf --user=pt2302 --password='root_\"f<=*password'";
|
||||
|
||||
@@ -71,7 +71,7 @@ unlike(
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
$sb->do_as_root("master", q/drop user pt2302/);
|
||||
$sb->do_as_root("source", q/drop user pt2302/);
|
||||
$sb->wipe_clean($dbh);
|
||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||
exit;
|
||||
|
@@ -20,7 +20,7 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
my $dbh = $sb->get_dbh_for('source');
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox';
|
||||
|
@@ -20,12 +20,12 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $master_dbh = $sb->get_dbh_for('master');
|
||||
my $source_dbh = $sb->get_dbh_for('source');
|
||||
my $has_keyring_plugin;
|
||||
|
||||
my $db_flavor = VersionParser->new($master_dbh)->flavor();
|
||||
my $db_flavor = VersionParser->new($source_dbh)->flavor();
|
||||
if ( $db_flavor =~ m/Percona Server/ ) {
|
||||
my $rows = $master_dbh->selectall_hashref("SHOW PLUGINS", "name");
|
||||
my $rows = $source_dbh->selectall_hashref("SHOW PLUGINS", "name");
|
||||
while (my ($key, $values) = each %$rows) {
|
||||
if ($key =~ m/^keyring_/) {
|
||||
$has_keyring_plugin=1;
|
||||
@@ -62,10 +62,14 @@ ok(
|
||||
|
||||
# If the box has a default my.cnf (e.g. /etc/my.cnf) there
|
||||
# should be 15 files, else 14.
|
||||
# Latest version creates 18 for PS/MySQL 8.0+
|
||||
# If run as regular user and there is default MySQL server, running as mysql user
|
||||
# there would be file collect.err, containing "Permission denied" error.
|
||||
# This error should be ignored.
|
||||
my @files = glob("$dir/*");
|
||||
my $n_files = scalar @files;
|
||||
ok(
|
||||
$n_files >= 15 && $n_files <= 18,
|
||||
$n_files >= 15 && $n_files <= 19,
|
||||
"And leaves all files in there"
|
||||
) or diag($n_files, `ls -l $dir`);
|
||||
|
||||
|
@@ -20,12 +20,12 @@ local $ENV{PTDEBUG} = "";
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
my $master_dbh = $sb->get_dbh_for('master');
|
||||
my $source_dbh = $sb->get_dbh_for('source');
|
||||
my $has_keyring_plugin;
|
||||
|
||||
my $db_flavor = VersionParser->new($master_dbh)->flavor();
|
||||
my $db_flavor = VersionParser->new($source_dbh)->flavor();
|
||||
if ( $db_flavor =~ m/Percona Server/ ) {
|
||||
my $rows = $master_dbh->selectall_hashref("SHOW PLUGINS", "name");
|
||||
my $rows = $source_dbh->selectall_hashref("SHOW PLUGINS", "name");
|
||||
while (my ($key, $values) = each %$rows) {
|
||||
if ($key =~ m/^keyring_/) {
|
||||
$has_keyring_plugin=1;
|
||||
@@ -101,8 +101,8 @@ like(
|
||||
# SQL Mode ANSI_QUOTES
|
||||
#
|
||||
|
||||
my ($orig_sql_mode) = $master_dbh->selectrow_array(q{SELECT @@SQL_MODE});
|
||||
$master_dbh->do("SET GLOBAL SQL_MODE='ANSI_QUOTES'");
|
||||
my ($orig_sql_mode) = $source_dbh->selectrow_array(q{SELECT @@SQL_MODE});
|
||||
$source_dbh->do("SET GLOBAL SQL_MODE='ANSI_QUOTES'");
|
||||
|
||||
$out = `$env $trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
|
||||
|
||||
@@ -124,7 +124,7 @@ like(
|
||||
"Security works with SQL Mode ANSI_QUOTES"
|
||||
);
|
||||
|
||||
$master_dbh->do("SET GLOBAL SQL_MODE='${orig_sql_mode}'");
|
||||
$source_dbh->do("SET GLOBAL SQL_MODE='${orig_sql_mode}'");
|
||||
|
||||
# --read-samples
|
||||
for my $i (2..9) {
|
||||
@@ -151,12 +151,12 @@ is(
|
||||
"--help works under sh and bash"
|
||||
);
|
||||
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
$master_dbh->do("CREATE DATABASE test");
|
||||
$master_dbh->do("CREATE TABLE test.t1(a INT PRIMARY KEY) ENCRYPTION='Y'");
|
||||
$master_dbh->do("CREATE TABLESPACE foo ADD DATAFILE 'foo.ibd' ENCRYPTION='Y'");
|
||||
$master_dbh->do("ALTER TABLE test.t1 TABLESPACE=foo");
|
||||
$master_dbh->do("CREATE TABLE test.t2(a INT PRIMARY KEY) ENCRYPTION='Y'");
|
||||
$source_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
$source_dbh->do("CREATE DATABASE test");
|
||||
$source_dbh->do("CREATE TABLE test.t1(a INT PRIMARY KEY) ENCRYPTION='Y'");
|
||||
$source_dbh->do("CREATE TABLESPACE foo ADD DATAFILE 'foo.ibd' ENCRYPTION='Y'");
|
||||
$source_dbh->do("ALTER TABLE test.t1 TABLESPACE=foo");
|
||||
$source_dbh->do("CREATE TABLE test.t2(a INT PRIMARY KEY) ENCRYPTION='Y'");
|
||||
|
||||
$out = `bash $trunk/bin/$tool --list-encrypted-tables -- --defaults-file=/tmp/12345/my.sandbox.cnf`;
|
||||
|
||||
@@ -184,9 +184,9 @@ like(
|
||||
"Encrypted tablespaces included in report"
|
||||
) or diag $out;
|
||||
|
||||
$master_dbh->do("DROP TABLE IF EXISTS test.t1");
|
||||
$master_dbh->do("DROP TABLE IF EXISTS test.t2");
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
$master_dbh->do("DROP TABLESPACE foo");
|
||||
$source_dbh->do("DROP TABLE IF EXISTS test.t1");
|
||||
$source_dbh->do("DROP TABLE IF EXISTS test.t2");
|
||||
$source_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
$source_dbh->do("DROP TABLESPACE foo");
|
||||
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user