PT-572 More tests fixed

This commit is contained in:
Carlos Salguero
2018-02-21 16:42:26 -03:00
parent 8943e0a9f6
commit ec25735ca4
9 changed files with 29 additions and 9 deletions

View File

@@ -5146,7 +5146,7 @@ sub watch_server {
if ( VersionParser->new($dbh) >= '5.6.5' && VersionParser->new($dbh) <= '10.0.0' ) {
my $row = $dbh->selectrow_arrayref('SELECT @@GLOBAL.gtid_mode');
PTDEBUG && _d('@@GLOBAL.gtid_mode:', $row->[0]);
if ( $row && $row->[0] eq 'ON' ) {
if ( $row && $row->[0] =~ m/^ON/ ) {
$have_gtid = 1;
}
}

View File

@@ -122,7 +122,8 @@ make_sandbox() {
fi
if [ -n "$GTID" ]; then
echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
#echo "gtid_mode=on" >> ${TMP_DIR}/$port/my.sandbox.cnf
echo "gtid_mode=ON_PERMISSIVE" >> ${TMP_DIR}/$port/my.sandbox.cnf
echo "enforce_gtid_consistency" >> ${TMP_DIR}/$port/my.sandbox.cnf
fi
if [ -n "$REPLICATION_THREADS" ]; then
@@ -222,6 +223,7 @@ make_sandbox() {
# If the sandbox is a slave, start the slave.
if [ "$type" = "slave" ]; then
#${TMP_DIR}/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"
${TMP_DIR}/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port"
${TMP_DIR}/$port/use -e "start slave"
fi
@@ -346,11 +348,11 @@ else
make_sandbox
# Slave mm2 -> mm1
${TMP_DIR}/$mm2_port/use -e "change master to master_host='127.0.0.1', master_log_file='mysql-bin.000001', master_log_pos=0, master_user='msandbox', master_password='msandbox', master_port=$mm1_port"
${TMP_DIR}/$mm2_port/use -e "change master to master_host='127.0.0.1', master_log_file='mysql-bin.000001', master_user='msandbox', master_password='msandbox', master_port=$mm1_port"
${TMP_DIR}/$mm2_port/use -e "start slave"
# Slave mm1 -> mm2
${TMP_DIR}/$mm1_port/use -e "change master to master_host='127.0.0.1', master_log_file='mysql-bin.000001', master_log_pos=0, master_user='msandbox', master_password='msandbox', master_port=$mm2_port"
${TMP_DIR}/$mm1_port/use -e "change master to master_host='127.0.0.1', master_log_file='mysql-bin.000001', master_user='msandbox', master_password='msandbox', master_port=$mm2_port"
${TMP_DIR}/$mm1_port/use -e "start slave"
fi
fi

View File

@@ -23,6 +23,10 @@ my $sb = Sandbox->new(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $dbh = $sb->get_dbh_for('slave1');
if ($sandbox_version ge '5.7') {
plan skip_all => 'Use SQL_DELAY';
}
if ( !$dbh ) {
plan skip_all => 'Cannot connect to MySQL slave.';
}

View File

@@ -21,6 +21,10 @@ my $master_dbh = $sb->get_dbh_for('master');
my $slave1_dbh = $sb->get_dbh_for('slave1');
my $slave2_dbh = $sb->get_dbh_for('slave2');
if ($sandbox_version ge '5.7') {
plan skip_all => 'Use SQL_DELAY';
}
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}

View File

@@ -21,6 +21,10 @@ my $dp = DSNParser->new(opts => $dsn_opts);
my $sb = Sandbox->new(basedir => '/tmp', DSNParser => $dp);
my $dbh = $sb->get_dbh_for('slave1');
if ($sandbox_version ge '5.7') {
plan skip_all => 'Use SQL_DELAY';
}
if ( !$dbh ) {
plan skip_all => 'Cannot connect to MySQL slave.';
}

View File

@@ -20,6 +20,10 @@ my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
my $slave_dbh = $sb->get_dbh_for('slave1');
if ($sandbox_version ge '5.7') {
plan skip_all => 'Use SQL_DELAY';
}
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}

View File

@@ -23,7 +23,7 @@ if ( $sandbox_version lt '5.6' ) {
diag("Stopping/reconfiguring/restarting sandboxes 12345, 12346 and 12347");
diag(`$trunk/sandbox/test-env stop >/dev/null`);
diag(`REPLICATION_THREADS=2 GTID=1 $trunk/sandbox/test-env start >/dev/null`);
diag(`REPLICATION_THREADS=2 GTID=ON_PERMISSIVE $trunk/sandbox/test-env start >/dev/null`);
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
@@ -57,8 +57,9 @@ like(
# Done.
# #############################################################################
diag(`rm -f /tmp/pt-slave-re*`);
diag(`$trunk/sandbox/test-env stop >/dev/null`);
diag(`$trunk/sandbox/test-env start >/dev/null`);
#
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;

View File

@@ -46,13 +46,14 @@ my @args = ('--sync-to-master', 'h=127.1,P=12346,u=msandbox,p=msandbox',
# use lib/samples dir since the main change is in DSNParser
$sb->load_file('master', "t/lib/samples/charset.sql");
my $want = encode('UTF-8','абвгд');
my $put = encode('UTF-8','абвгд');
my $want = 'абвгд';
$master_dbh->do("SET NAMES 'utf8'");
$slave1_dbh->do("SET NAMES 'utf8'");
$slave1_dbh->do("SET NAMES 'utf8'");
$master_dbh->do("INSERT INTO test.t1 VALUES (NULL, '$want')");
$master_dbh->do("INSERT INTO test.t1 VALUES (NULL, '$put')");
$sb->wait_for_slaves();
$slave1_dbh->do("DELETE FROM test.t1 WHERE id=1 LIMIT 1");

View File

@@ -45,7 +45,7 @@ $dbh->do("CREATE TABLE IF NOT EXISTS percona_test.load_data (i int)");
`echo 1 > /tmp/load_data_test.$$`;
eval {
$dbh->do("LOAD DATA LOCAL INFILE '/tmp/load_data_test.$$' INTO TABLE percona_test.load_data");
$dbh->do("LOAD DATA INFILE '/tmp/load_data_test.$$' INTO TABLE percona_test.load_data");
};
if ( $EVAL_ERROR ) {