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

@@ -19,14 +19,14 @@ require "$trunk/bin/pt-online-schema-change";
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 slave1';
elsif ( !$replica_dbh ) {
plan skip_all => 'Cannot connect to sandbox replica1';
}
elsif ($sb->is_cluster_mode) {
plan skip_all => 'Not for PXC';
@@ -35,7 +35,7 @@ elsif ($sb->is_cluster_mode) {
# The sandbox servers run with lock_wait_timeout=3 and it's not dynamic
# so we need to specify --set-vars innodb_lock_wait_timeout=3 else the
# tool will die.
my $master_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
my $source_dsn = 'h=127.1,P=12345,u=msandbox,p=msandbox';
my @args = (qw(--set-vars innodb_lock_wait_timeout=3));
my $sample = "t/pt-online-schema-change/samples/";
my $plugin = "$trunk/$sample/plugins";
@@ -46,11 +46,11 @@ my $exit_status;
# https://bugs.launchpad.net/percona-toolkit/+bug/1171653
#
# ############################################################################
$sb->load_file('master', "$sample/basic_no_fks.sql");
$sb->load_file('source', "$sample/basic_no_fks.sql");
($output, $exit_status) = full_output(
sub { pt_online_schema_change::main(@args,
"$master_dsn,D=pt_osc,t=t",
"$source_dsn,D=pt_osc,t=t",
"--alter", "CHARACTER SET utf8, MODIFY c CHAR(128) CHARACTER SET utf8",
'--plugin', "$plugin/show_create_new_table.pm",
qw(--quiet --execute)) },
@@ -67,6 +67,6 @@ like(
# #############################################################################
# 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;