PT-2340 - Support MySQL 8.4

- Updated modules and tests for pt-online-schema-change
- Removed typo from lib/MasterSlave.pm
This commit is contained in:
Sveta Smirnova
2024-07-29 18:47:13 +03:00
parent 5c999ca3e0
commit 76c1202cb5
69 changed files with 1606 additions and 1380 deletions

View File

@@ -20,14 +20,14 @@ use Data::Dumper;
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
my $source_dbh = $sb->get_dbh_for('source');
my $replica_dbh = $sb->get_dbh_for('replica1');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
if ( !$source_dbh ) {
plan skip_all => 'Cannot connect to sandbox source';
}
elsif ( !$slave_dbh ) {
plan skip_all => 'Cannot connect to sandbox slave';
elsif ( !$replica_dbh ) {
plan skip_all => 'Cannot connect to sandbox replica';
}
my @args = qw(--set-vars innodb_lock_wait_timeout=3);
@@ -36,7 +36,7 @@ my $dsn = "h=127.1,P=12345,u=msandbox,p=msandbox";
my $exit = 0;
my $sample = "t/pt-online-schema-change/samples";
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
$sb->load_file('source', "$sample/basic_no_fks_innodb.sql");
# #############################################################################
# --where does not run without --no-drop-new-table and --no-swap-tables
@@ -127,7 +127,7 @@ is(
'Rows, satisfying --where condition are not copied'
) or diag($output);
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
$sb->load_file('source', "$sample/basic_no_fks_innodb.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t",
@@ -157,7 +157,7 @@ is(
# Same test with chunk size = 1
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
$sb->load_file('source', "$sample/basic_no_fks_innodb.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t",
@@ -186,7 +186,7 @@ is(
'Rows, satisfying --where condition are not copied'
) or diag($output);
$sb->load_file('master', "$sample/basic_no_fks_innodb.sql");
$sb->load_file('source', "$sample/basic_no_fks_innodb.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=t",
@@ -219,7 +219,7 @@ is(
# Option --where and foreign keys
# #############################################################################
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -261,7 +261,7 @@ is(
'Table address not modified'
) or diag($output);
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -303,7 +303,7 @@ is(
'Table address not modified'
) or diag($output);
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -345,7 +345,7 @@ is(
'Table address not modified'
) or diag($output);
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
$output = output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -387,7 +387,7 @@ is(
'Table address not modified'
) or diag($output);
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
($output, $exit) = full_output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -415,7 +415,7 @@ is(
'Table address not modified'
) or diag($output);
$sb->load_file('master', "$sample/basic_with_fks.sql");
$sb->load_file('source', "$sample/basic_with_fks.sql");
($output, $exit) = full_output(
sub { pt_online_schema_change::main(@args, "$dsn,D=pt_osc,t=city",
@@ -440,7 +440,7 @@ is(
# Done.
# #############################################################################
$sb->wipe_clean($master_dbh);
$sb->wipe_clean($source_dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
#
done_testing;