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-duplicate-key-checker";
18
my $dp = new DSNParser(opts=>$dsn_opts);
19
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
20
my $dbh = $sb->get_dbh_for('master');
23
plan skip_all => 'Cannot connect to sandbox master';
29
my $cnf = "/tmp/12345/my.sandbox.cnf";
30
my $sample = "t/pt-duplicate-key-checker/samples/";
31
my @args = ('-F', $cnf, qw(-h 127.1));
33
$sb->wipe_clean($dbh);
34
$sb->create_dbs($dbh, ['test']);
36
# #############################################################################
37
# Issue 331: mk-duplicate-key-checker crashes getting size of foreign keys
38
# #############################################################################
40
$sb->load_file('master', 't/pt-duplicate-key-checker/samples/issue_331.sql', 'test');
43
sub { mk_duplicate_key_checker::main(@args, qw(-d issue_331)) },
44
't/pt-duplicate-key-checker/samples/issue_331.txt',
46
'Issue 331 crash on fks'
49
# #############################################################################
51
# #############################################################################
52
$sb->wipe_clean($dbh);