mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 21:54:48 +00:00
PT-2340 - Support MySQL 8.4
- Updated modules and tests for pt-query-digest, pt-show-grants, pt-slave-delay, pt-slave-find, pt-slave-restart, pt-stalk, pt-summary, pt-table-checksum
This commit is contained in:
@@ -15,13 +15,14 @@ use Sandbox;
|
||||
use PerconaTest;
|
||||
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
|
||||
my $output = '';
|
||||
|
@@ -14,13 +14,14 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use DSNParser;
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 4;
|
||||
|
@@ -15,10 +15,11 @@ use Test::More tests => 7;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use DSNParser;
|
||||
require VersionParser;
|
||||
|
||||
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 $output;
|
||||
|
||||
@@ -41,7 +42,7 @@ like(
|
||||
# Daemonizing and pid creation
|
||||
# #########################################################################
|
||||
SKIP: {
|
||||
skip "Cannot connect to sandbox master", 5 unless $dbh;
|
||||
skip "Cannot connect to sandbox source", 5 unless $dbh;
|
||||
|
||||
my $cmd = "$trunk/bin/pt-query-digest --daemonize --pid $pid_file --processlist h=127.1,P=12345,u=msandbox,p=msandbox --log /dev/null";
|
||||
`$cmd`;
|
||||
|
@@ -15,13 +15,14 @@ use Sandbox;
|
||||
use PerconaTest;
|
||||
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
|
||||
$dbh->do('drop database if exists food');
|
||||
@@ -134,7 +135,7 @@ ok(
|
||||
# #############################################################################
|
||||
# Issue 1196: mk-query-digest --explain is broken
|
||||
# #############################################################################
|
||||
$sb->load_file('master', "t/pt-query-digest/samples/issue_1196.sql");
|
||||
$sb->load_file('source', "t/pt-query-digest/samples/issue_1196.sql");
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
|
@@ -18,13 +18,13 @@ use Sandbox;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
elsif ( VersionParser->new($dbh) < '5.1' ) {
|
||||
plan skip_all => 'Sandbox master version not >= 5.1';
|
||||
plan skip_all => 'Sandbox source version not >= 5.1';
|
||||
}
|
||||
else {
|
||||
plan tests => 2;
|
||||
|
@@ -14,13 +14,14 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
|
||||
sub normalize_numbers {
|
||||
@@ -49,7 +50,7 @@ my $output;
|
||||
my $cmd;
|
||||
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
$sb->load_file('master', 't/pt-query-digest/samples/query_review.sql');
|
||||
$sb->load_file('source', 't/pt-query-digest/samples/query_review.sql');
|
||||
|
||||
# Test --create-review and --create-review-history-table
|
||||
$output = run_with("slow006.txt", '--create-history-table',
|
||||
|
@@ -14,13 +14,14 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use DSNParser;
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 3;
|
||||
|
@@ -14,13 +14,14 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use DSNParser;
|
||||
use Sandbox;
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 3;
|
||||
|
@@ -14,6 +14,7 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
use Data::Dumper;
|
||||
$Data::Dumper::Indent = 1;
|
||||
@@ -22,10 +23,10 @@ $Data::Dumper::Quotekeys = 0;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
|
||||
my @args = qw(-F /tmp/12345/my.sandbox.cnf --processlist h=127.1 --report-format query_report);
|
||||
|
@@ -14,6 +14,7 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use DSNParser;
|
||||
use Sandbox;
|
||||
require VersionParser;
|
||||
|
||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||
@@ -22,10 +23,10 @@ if ( $sandbox_version lt '8.0') {
|
||||
plan skip_all => "Requires MySQL 8.0 or newer";
|
||||
}
|
||||
|
||||
my $dbh = $sb->get_dbh_for('master');
|
||||
my $dbh = $sb->get_dbh_for('source');
|
||||
|
||||
if ( !$dbh ) {
|
||||
plan skip_all => 'Cannot connect to sandbox master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 3;
|
||||
|
@@ -15,13 +15,14 @@ use PerconaTest;
|
||||
use Sandbox;
|
||||
use SqlModes;
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
|
||||
sub normalize_numbers {
|
||||
@@ -47,7 +48,7 @@ my $output;
|
||||
my $cmd;
|
||||
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
$sb->load_file('master', 't/pt-query-digest/samples/query_review.sql');
|
||||
$sb->load_file('source', 't/pt-query-digest/samples/query_review.sql');
|
||||
|
||||
# Test --create-review
|
||||
$output = run_with("slow006.txt", qw(--create-review-table),
|
||||
@@ -188,7 +189,7 @@ unlike($output, qr/Use of uninitialized value/, 'no crash due to totally missing
|
||||
# #############################################################################
|
||||
# --review --no-report
|
||||
# #############################################################################
|
||||
$sb->load_file('master', 't/pt-query-digest/samples/query_review.sql');
|
||||
$sb->load_file('source', 't/pt-query-digest/samples/query_review.sql');
|
||||
$output = run_with("slow006.txt", '--no-report',
|
||||
'--review', "$dsn,D=test,t=query_review");
|
||||
|
||||
|
@@ -15,13 +15,14 @@ use PerconaTest;
|
||||
use Sandbox;
|
||||
use Time::HiRes qw(sleep);
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 11;
|
||||
|
@@ -14,10 +14,11 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
require VersionParser;
|
||||
|
||||
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 @args = (qw(--report-format query_report --limit 10));
|
||||
my $sample_in = "$trunk/t/lib/samples/slowlogs";
|
||||
@@ -115,9 +116,9 @@ ok(
|
||||
);
|
||||
|
||||
SKIP: {
|
||||
skip 'Cannot connect to sandbox master', 2 unless $dbh;
|
||||
skip 'Cannot connect to sandbox source', 2 unless $dbh;
|
||||
|
||||
my $dsn = $sb->dsn_for('master');
|
||||
my $dsn = $sb->dsn_for('source');
|
||||
|
||||
# The result file is correct: it's the one that has all quries from
|
||||
# slow033.txt.
|
||||
|
@@ -14,13 +14,14 @@ use Test::More;
|
||||
use PerconaTest;
|
||||
use Sandbox;
|
||||
use DSNParser;
|
||||
require VersionParser;
|
||||
|
||||
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 master';
|
||||
plan skip_all => 'Cannot connect to sandbox source';
|
||||
}
|
||||
else {
|
||||
plan tests => 2;
|
||||
|
Reference in New Issue
Block a user