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-checksum";
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');
23
plan skip_all => 'Cannot connect to sandbox master';
30
my $cnf='/tmp/12345/my.sandbox.cnf';
31
my $cmd = "$trunk/bin/pt-table-checksum -F $cnf 127.0.0.1";
33
$sb->create_dbs($master_dbh, [qw(test)]);
34
$sb->load_file('master', 't/pt-table-checksum/samples/before.sql');
36
# #############################################################################
37
# Issue 81: put some data that's too big into the boundaries table
38
# #############################################################################
39
$sb->load_file('master', 't/pt-table-checksum/samples/checksum_tbl_truncated.sql');
40
$output = `$cmd --ignore-databases sakila,mysql --empty-replicate-table --replicate test.checksum 2>&1`;
41
like($output, qr/boundaries/, 'Truncation causes an error');
43
# #############################################################################
45
# #############################################################################
46
$sb->wipe_clean($master_dbh);