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-log-player";
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
# #############################################################################
30
# Issue 903: mk-log-player --only-select does not handle comments
31
# #############################################################################
33
# This should not cause an error because the leading comment
34
# prevents the query from looking like a SELECT.
36
$output = `$trunk/bin/pt-log-player --threads 1 --play $trunk/t/pt-log-player/samples/issue_903.txt h=127.1,P=12345,u=msandbox,p=msandbox,D=mysql 2>&1`;
40
'Error without --only-select'
43
# This will cause an error now, too, because the leading comment
45
$output = `$trunk/bin/pt-log-player --threads 1 --play $trunk/t/pt-log-player/samples/issue_903.txt h=127.1,P=12345,u=msandbox,p=msandbox,D=mysql --only-select 2>&1`;
49
'Error with --only-select'
52
# #############################################################################
54
# #############################################################################
55
diag(`rm -rf ./session-results-*`);