mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 13:11:32 +00:00
pt-archiver & tests: Deal with LOAD DATA LOCAL INFILE being disabled.
This occasionally shows up in some OSs, like Ubuntu 12.04 LTS.
This commit is contained in:
@@ -3945,6 +3945,22 @@ sub main {
|
||||
$dp->get_cxn_params($table), { AutoCommit => $ac });
|
||||
PTDEBUG && _d('Inspecting table on', $dp->as_string($table));
|
||||
|
||||
if ( $o->get('bulk-insert') ) {
|
||||
local $@;
|
||||
my $sql = "LOAD DATA LOCAL INFILE '/dev/null' INTO TABLE "
|
||||
. "`test`.`pt_not_there`";
|
||||
eval { $dbh->do($sql); 1 } or do {
|
||||
my $e = $@;
|
||||
my $error_re = qr/\QDBD::mysql::db do failed: The used command is not allowed with this MySQL version [for Statement "LOAD DATA LOCAL INFILE/;
|
||||
if ($e =~ $error_re) {
|
||||
$dbh->disconnect();
|
||||
die("--bulk-insert cannot work as LOAD DATA LOCAL INFILE "
|
||||
. "is disabled. See http://kb.percona.com/troubleshoot-load-data-infile"
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
# Set options that can enable removing data on the master and archiving it
|
||||
# on the slaves.
|
||||
if ( $table->{a} ) {
|
||||
|
Reference in New Issue
Block a user