31
35
my $cnf = "/tmp/12345/my.sandbox.cnf";
32
36
my $cmd = "$trunk/bin/pt-archiver";
38
if ( PerconaTest::load_data_is_disabled($dbh) ) {
39
test_disabled_load_data($dbh, $sb, 'master', $cnf);
34
43
$sb->wipe_clean($dbh);
35
44
$sb->create_dbs($dbh, ['test']);
84
93
"--bulk-insert archived 7 rows (issue 1260)"
96
# Test that the tool bails out early if LOAD DATA LOCAL INFILE is disabled
98
if ( -d "/tmp/2900" ) {
99
diag(`$trunk/sandbox/stop-sandbox 2900 >/dev/null 2>&1`);
102
local $ENV{LOCAL_INFILE} = 0;
103
diag(`$trunk/sandbox/start-sandbox master 2900 >/dev/null 2>&1`);
105
my $master3_dbh = $sb->get_dbh_for('master3');
107
test_disabled_load_data($master3_dbh, $sb, 'master3', "/tmp/2900/my.sandbox.cnf");
109
diag(`$trunk/sandbox/stop-sandbox 2900 >/dev/null 2>&1`);
110
$master3_dbh->disconnect() if $master3_dbh;
115
sub test_disabled_load_data {
116
my ($dbh, $sb, $master, $cnf) = @_;
117
$sb->wipe_clean($dbh);
118
$sb->create_dbs($dbh, ['test']);
119
$sb->load_file($master, 't/pt-archiver/samples/table5.sql');
120
$dbh->do('INSERT INTO `test`.`table_5_copy` SELECT * FROM `test`.`table_5`');
122
my ($output, undef) = full_output(
123
sub { pt_archiver::main(qw(--no-ascend --limit 50 --bulk-insert),
124
qw(--bulk-delete --where 1=1 --statistics),
125
'--source', "D=test,t=table_5,F=$cnf",
126
'--dest', "t=table_5_dest") },
130
qr!\Q--bulk-insert cannot work as LOAD DATA LOCAL INFILE is disabled. See http://kb.percona.com/troubleshoot-load-data-infile!,
131
"--bulk-insert throws an error if LOCAL INFILE is disabled"
87
135
# #############################################################################
89
137
# #############################################################################