mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-27 07:54:58 +00:00
Some changes that somehow went missing during the merge
This commit is contained in:
@@ -3949,6 +3949,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} ) {
|
||||
|
@@ -36,7 +36,7 @@ my $cnf = "/tmp/12345/my.sandbox.cnf";
|
||||
my $cmd = "$trunk/bin/pt-archiver";
|
||||
|
||||
if ( PerconaTest::load_data_is_disabled($dbh) ) {
|
||||
test_disabled_load_data($dbh, $sb);
|
||||
test_disabled_load_data($dbh, $sb, 'master', $cnf);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -104,7 +104,7 @@ is_deeply(
|
||||
|
||||
my $master3_dbh = $sb->get_dbh_for('master3');
|
||||
|
||||
test_disabled_load_data($master3_dbh, $sb);
|
||||
test_disabled_load_data($master3_dbh, $sb, 'master3', "/tmp/2900/my.sandbox.cnf");
|
||||
|
||||
diag(`$trunk/sandbox/stop-sandbox 2900 >/dev/null 2>&1`);
|
||||
$master3_dbh->disconnect() if $master3_dbh;
|
||||
@@ -113,10 +113,10 @@ is_deeply(
|
||||
}
|
||||
|
||||
sub test_disabled_load_data {
|
||||
my ($dbh, $sb) = @_;
|
||||
my ($dbh, $sb, $master, $cnf) = @_;
|
||||
$sb->wipe_clean($dbh);
|
||||
$sb->create_dbs($dbh, ['test']);
|
||||
$sb->load_file('master', 't/pt-archiver/samples/table5.sql');
|
||||
$sb->load_file($master, 't/pt-archiver/samples/table5.sql');
|
||||
$dbh->do('INSERT INTO `test`.`table_5_copy` SELECT * FROM `test`.`table_5`');
|
||||
|
||||
my ($output, undef) = full_output(
|
||||
|
Reference in New Issue
Block a user