mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
PT-1572 Fixed MySQL 8 tests
This commit is contained in:
@@ -27,6 +27,13 @@ else {
|
|||||||
plan tests => 3;
|
plan tests => 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This table is being used by some other tests and it is not being properly cleaned
|
||||||
|
# so this tests fails sometimes. Just in case, clean the table but don't fail if the
|
||||||
|
# table doesn't exists.
|
||||||
|
eval {
|
||||||
|
$dbh->do("TRUNCATE TABLE percona_test.load_data");
|
||||||
|
};
|
||||||
|
|
||||||
$sb->load_file('master', 't/lib/samples/issue_pt-193_backtick_in_col_comments.sql');
|
$sb->load_file('master', 't/lib/samples/issue_pt-193_backtick_in_col_comments.sql');
|
||||||
|
|
||||||
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
|
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
|
||||||
@@ -49,7 +56,7 @@ is(
|
|||||||
$exit_status,
|
$exit_status,
|
||||||
0,
|
0,
|
||||||
"PT-193 use single backtick in comments",
|
"PT-193 use single backtick in comments",
|
||||||
);
|
) or diag($output);
|
||||||
|
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
|
@@ -6,6 +6,9 @@ BEGIN {
|
|||||||
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
binmode(STDIN, ':utf8') or die "Can't binmode(STDIN, ':utf8'): $OS_ERROR";
|
||||||
|
binmode(STDOUT, ':utf8') or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use utf8;
|
use utf8;
|
||||||
use Encode qw(decode encode);
|
use Encode qw(decode encode);
|
||||||
@@ -17,9 +20,6 @@ use PerconaTest;
|
|||||||
use Sandbox;
|
use Sandbox;
|
||||||
require "$trunk/bin/pt-table-sync";
|
require "$trunk/bin/pt-table-sync";
|
||||||
|
|
||||||
binmode(STDIN, ':utf8') or die "Can't binmode(STDIN, ':utf8'): $OS_ERROR";
|
|
||||||
binmode(STDOUT, ':utf8') or die "Can't binmode(STDOUT, ':utf8'): $OS_ERROR";
|
|
||||||
|
|
||||||
my $dp = new DSNParser(opts=>$dsn_opts);
|
my $dp = new DSNParser(opts=>$dsn_opts);
|
||||||
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
||||||
my $master_dbh = $sb->get_dbh_for('master');
|
my $master_dbh = $sb->get_dbh_for('master');
|
||||||
@@ -39,9 +39,10 @@ else {
|
|||||||
plan tests => 5;
|
plan tests => 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my ($output, $status);
|
my ($output, $status);
|
||||||
my @args = ('--sync-to-master', 'h=127.1,P=12346,u=msandbox,p=msandbox',
|
my @args = ('--sync-to-master', 'h=127.1,P=12346,u=msandbox,p=msandbox',
|
||||||
qw(-t test.t1 --print --execute));
|
qw(-t test.t1 --print --execute --charset utf8));
|
||||||
|
|
||||||
# use lib/samples dir since the main change is in DSNParser
|
# use lib/samples dir since the main change is in DSNParser
|
||||||
$sb->load_file('master', "t/lib/samples/charset.sql");
|
$sb->load_file('master', "t/lib/samples/charset.sql");
|
||||||
@@ -77,10 +78,10 @@ is(
|
|||||||
$row->{f2},
|
$row->{f2},
|
||||||
$want,
|
$want,
|
||||||
"Character set is correct",
|
"Character set is correct",
|
||||||
) or diag("Want '$want', got '$row->{f2}");
|
) or diag("Want '".($want||"")."', got '".($row->{f2}||"")."'");
|
||||||
|
|
||||||
SKIP: {
|
SKIP: {
|
||||||
skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself", 1 if ($sandbox_version ge '8.0');
|
skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself", 2 if ($sandbox_version ge '8.0');
|
||||||
# 3
|
# 3
|
||||||
$output = `$trunk/bin/pt-table-sync --execute --lock-and-rename h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=t1 t=t2 2>&1`;
|
$output = `$trunk/bin/pt-table-sync --execute --lock-and-rename h=127.1,P=12345,u=msandbox,p=msandbox,D=test,t=t1 t=t2 2>&1`;
|
||||||
$output = `/tmp/12345/use -e 'show create table test.t2'`;
|
$output = `/tmp/12345/use -e 'show create table test.t2'`;
|
||||||
|
Reference in New Issue
Block a user