4
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
5
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
6
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
10
use warnings FATAL => 'all';
11
use English qw(-no_match_vars);
16
require "$trunk/bin/pt-table-sync";
18
my $dp = new DSNParser(opts=>$dsn_opts);
19
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
20
my $master_dbh = $sb->get_dbh_for('master');
21
my $slave_dbh = $sb->get_dbh_for('slave1');
24
plan skip_all => 'Cannot connect to sandbox master';
26
elsif ( !$slave_dbh ) {
27
plan skip_all => 'Cannot connect to sandbox slave';
34
my @args = ('h=127.0.0.1,P=12346,u=msandbox,p=msandbox', qw(--sync-to-master -t sakila.actor -v -v --print --chunk-size 100));
37
sub { mk_table_sync::main(@args) },
41
qr/WHERE \(`actor_id` = 0\)/,
46
sub { mk_table_sync::main(@args, qw(--no-zero-chunk)) },
50
qr/WHERE \(`actor_id` = 0\)/,
54
# #############################################################################
56
# #############################################################################
57
$sb->wipe_clean($master_dbh);