mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
PT-2340 - Support MySQL 8.4
- Fixed 5.7 tests
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
STOP SLAVE FOR CHANNEL '';
|
||||||
|
SET GLOBAL master_info_repository = 'TABLE';
|
||||||
|
SET @@GLOBAL.relay_log_info_repository = 'TABLE';
|
||||||
|
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON;
|
||||||
|
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
|
||||||
|
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
|
||||||
|
SET @@GLOBAL.GTID_MODE = ON;
|
||||||
|
|
||||||
|
CHANGE MASTER TO master_host='127.0.0.1', master_port=2900, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'sourcechan1';
|
||||||
|
|
||||||
|
CHANGE MASTER TO master_host='127.0.0.1', master_port=2901, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'sourcechan2';
|
||||||
|
|
||||||
|
START SLAVE for channel 'sourcechan1';
|
||||||
|
START SLAVE for channel 'sourcechan2';
|
||||||
|
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
STOP REPLICA FOR CHANNEL '';
|
||||||
|
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON;
|
||||||
|
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
|
||||||
|
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
|
||||||
|
SET @@GLOBAL.GTID_MODE = ON;
|
||||||
|
|
||||||
|
CHANGE REPLICATION SOURCE TO source_host='127.0.0.1', source_port=2900, source_user='msandbox', source_password='msandbox', source_auto_position=1 FOR CHANNEL 'sourcechan1';
|
||||||
|
|
||||||
|
CHANGE REPLICATION SOURCE TO source_host='127.0.0.1', source_port=2901, source_user='msandbox', source_password='msandbox', source_auto_position=1 FOR CHANNEL 'sourcechan2';
|
||||||
|
|
||||||
|
START REPLICA for channel 'sourcechan1';
|
||||||
|
START REPLICA for channel 'sourcechan2';
|
||||||
|
|
||||||
+9
-3
@@ -782,9 +782,15 @@ SKIP: {
|
|||||||
);
|
);
|
||||||
my $slave1_port = $sb->port_for('chan_replica1');
|
my $slave1_port = $sb->port_for('chan_replica1');
|
||||||
|
|
||||||
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
if ( $sandbox_version lt '8.1' ) {
|
||||||
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source1', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source2', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels-legacy.sql", undef, no_wait => 1);
|
||||||
|
} else {
|
||||||
|
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
||||||
|
}
|
||||||
|
|
||||||
my $chan_slaves;
|
my $chan_slaves;
|
||||||
eval {
|
eval {
|
||||||
|
|||||||
+9
-9
@@ -1062,15 +1062,15 @@ SKIP: {
|
|||||||
# We need to create a new server here, otherwise the whole test suite might die
|
# We need to create a new server here, otherwise the whole test suite might die
|
||||||
# if the crashed table can't be dropped.
|
# if the crashed table can't be dropped.
|
||||||
|
|
||||||
my $master3_port = 2900;
|
my $source3_port = 2900;
|
||||||
my $master_basedir = "/tmp/$master3_port";
|
my $source_basedir = "/tmp/$source3_port";
|
||||||
diag(`$trunk/sandbox/stop-sandbox $master3_port >/dev/null`);
|
diag(`$trunk/sandbox/stop-sandbox $source3_port >/dev/null`);
|
||||||
diag(`$trunk/sandbox/start-sandbox master $master3_port >/dev/null`);
|
diag(`$trunk/sandbox/start-sandbox source $source3_port >/dev/null`);
|
||||||
my $dbh3 = $sb->get_dbh_for("master3");
|
my $dbh3 = $sb->get_dbh_for("source3");
|
||||||
|
|
||||||
$sb->load_file('master3', "t/lib/samples/bug_1047335_crashed_table.sql");
|
$sb->load_file('source3', "t/lib/samples/bug_1047335_crashed_table.sql");
|
||||||
|
|
||||||
my $db_dir = "$master_basedir/data/bug_1047335";
|
my $db_dir = "$source_basedir/data/bug_1047335";
|
||||||
my $myi = glob("$db_dir/crashed_table.[Mm][Yy][Iy]");
|
my $myi = glob("$db_dir/crashed_table.[Mm][Yy][Iy]");
|
||||||
my $frm = glob("$db_dir/crashed_table.[Ff][Rr][Mm]");
|
my $frm = glob("$db_dir/crashed_table.[Ff][Rr][Mm]");
|
||||||
|
|
||||||
@@ -1107,7 +1107,7 @@ SKIP: {
|
|||||||
$dbh3->do(q{CREATE DATABASE bug_1047335_2});
|
$dbh3->do(q{CREATE DATABASE bug_1047335_2});
|
||||||
|
|
||||||
my $broken_frm = "$trunk/t/lib/samples/broken_tbl.frm";
|
my $broken_frm = "$trunk/t/lib/samples/broken_tbl.frm";
|
||||||
my $db_dir_2 = "$master_basedir/data/bug_1047335_2";
|
my $db_dir_2 = "$source_basedir/data/bug_1047335_2";
|
||||||
|
|
||||||
diag(`cp $broken_frm $db_dir_2 2>&1`);
|
diag(`cp $broken_frm $db_dir_2 2>&1`);
|
||||||
|
|
||||||
@@ -1119,7 +1119,7 @@ SKIP: {
|
|||||||
"get_create_table dies if SHOW CREATE TABLE failed (using broken_tbl.frm)",
|
"get_create_table dies if SHOW CREATE TABLE failed (using broken_tbl.frm)",
|
||||||
);
|
);
|
||||||
|
|
||||||
diag(`$trunk/sandbox/stop-sandbox $master3_port >/dev/null`);
|
diag(`$trunk/sandbox/stop-sandbox $source3_port >/dev/null`);
|
||||||
}
|
}
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
|||||||
@@ -45,9 +45,15 @@ my ($replica1_dbh, $replica1_dsn) = $sb->start_sandbox(
|
|||||||
);
|
);
|
||||||
my $replica1_port = $sb->port_for('chan_replica1');
|
my $replica1_port = $sb->port_for('chan_replica1');
|
||||||
|
|
||||||
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
if ( $sandbox_version lt '8.1' ) {
|
||||||
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source1', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source2', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels-legacy.sql", undef, no_wait => 1);
|
||||||
|
} else {
|
||||||
|
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
||||||
|
}
|
||||||
|
|
||||||
my $source1_port = $sb->port_for('chan_source1');
|
my $source1_port = $sb->port_for('chan_source1');
|
||||||
my $num_rows = 40000;
|
my $num_rows = 40000;
|
||||||
|
|||||||
@@ -776,15 +776,20 @@ SKIP: {
|
|||||||
);
|
);
|
||||||
my $replica1_port = $sb->port_for('chan_replica1');
|
my $replica1_port = $sb->port_for('chan_replica1');
|
||||||
|
|
||||||
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
if ( $sandbox_version lt '8.1' ) {
|
||||||
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source1', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source2', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels_t-legacy.sql", undef, no_wait => 1);
|
||||||
|
} else {
|
||||||
|
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels_t.sql", undef, no_wait => 1);
|
||||||
|
}
|
||||||
|
|
||||||
my $replica_cnf = "/tmp/$replica1_port/my.sandbox.cnf";
|
my $replica_cnf = "/tmp/$replica1_port/my.sandbox.cnf";
|
||||||
my $cmd = "$trunk/bin/pt-stalk --no-stalk --iterations=1 --host=127.0.0.1 --port=$replica1_port --user=msandbox "
|
my $cmd = "$trunk/bin/pt-stalk --no-stalk --iterations=1 --host=127.0.0.1 --port=$replica1_port --user=msandbox "
|
||||||
. "--password=msandbox --sleep 0 --run-time=10 --dest $dest --log $log_file --iterations=1 "
|
. "--password=msandbox --sleep 0 --run-time=10 --dest $dest --log $log_file --iterations=1 "
|
||||||
. "--run-time=2 --pid $pid_file --defaults-file=$replica_cnf >$log_file 2>&1";
|
. "--run-time=2 --pid $pid_file --defaults-file=$replica_cnf >$log_file 2>&1";
|
||||||
diag ($cmd);
|
|
||||||
system($cmd);
|
system($cmd);
|
||||||
sleep 5;
|
sleep 5;
|
||||||
PerconaTest::kill_program(pid_file => $pid_file);
|
PerconaTest::kill_program(pid_file => $pid_file);
|
||||||
|
|||||||
@@ -45,9 +45,15 @@ my ($replica1_dbh, $replica1_dsn) = $sb->start_sandbox(
|
|||||||
);
|
);
|
||||||
my $replica1_port = $sb->port_for('chan_replica1');
|
my $replica1_port = $sb->port_for('chan_replica1');
|
||||||
|
|
||||||
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
if ( $sandbox_version lt '8.1' ) {
|
||||||
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source1', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
$sb->load_file('chan_source2', "sandbox/gtid_on-legacy.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels-legacy.sql", undef, no_wait => 1);
|
||||||
|
} else {
|
||||||
|
$sb->load_file('chan_source1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_source2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||||
|
$sb->load_file('chan_replica1', "sandbox/replica_channels.sql", undef, no_wait => 1);
|
||||||
|
}
|
||||||
|
|
||||||
my @args = qw(--execute --no-foreign-key-checks --verbose --databases=sakila --tables=actor --sync-to-source --channel=sourcechan1);
|
my @args = qw(--execute --no-foreign-key-checks --verbose --databases=sakila --tables=actor --sync-to-source --channel=sourcechan1);
|
||||||
my $exit_status;
|
my $exit_status;
|
||||||
@@ -61,7 +67,7 @@ like (
|
|||||||
$output,
|
$output,
|
||||||
qr/sakila.actor/,
|
qr/sakila.actor/,
|
||||||
'Synced actor table'
|
'Synced actor table'
|
||||||
);
|
) or diag($output);
|
||||||
|
|
||||||
$sb->stop_sandbox(qw(chan_source1 chan_source2 chan_replica1));
|
$sb->stop_sandbox(qw(chan_source1 chan_source2 chan_replica1));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user