Remove LOAD DATA check from pt-archiver and pt-upgrade. Make test-env check if LOAD DATA works and PerconaTest export . Rewrite how pt-archiver/t/bulk_insert.t conditionalizes on LOAD DATA working.

This commit is contained in:
Daniel Nichter
2012-07-31 15:37:02 -06:00
parent 702d475eda
commit 570b26de20
8 changed files with 46 additions and 127 deletions

View File

@@ -68,6 +68,7 @@ our @EXPORT = qw(
$trunk
$dsn_opts
$sandbox_version
$can_load_data
);
our $trunk = $ENV{PERCONA_TOOLKIT_BRANCH};
@@ -78,6 +79,8 @@ eval {
$sandbox_version = $v if $v;
};
our $can_load_data = can_load_data();
our $dsn_opts = [
{
key => 'A',
@@ -777,17 +780,9 @@ sub tables_used {
return [ sort keys %tables ];
}
sub load_data_is_disabled {
my ($dbh) = @_;
my $sql = "LOAD DATA LOCAL INFILE '/dev/null' INTO TABLE "
. "`t`.`pt_not_there`";
local $@;
if (!eval { $dbh->do($sql); 1 } ) {
my $e = $@;
return 1 if $e =~ qr/\QDBD::mysql::db do failed: The used command is not allowed with this MySQL version [for Statement "LOAD DATA LOCAL INFILE/;
}
return;
sub can_load_data {
my $output = `/tmp/12345/use -e "SELECT * FROM percona_test.load_data" 2>/dev/null`;
return ($output || '') =~ /42/;
}
1;