mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 14:18:32 +00:00
t/pt-archiver/bulk_insert.t: Don't assume that the db is already there
This commit is contained in:
@@ -35,13 +35,14 @@ my $rows;
|
|||||||
my $cnf = "/tmp/12345/my.sandbox.cnf";
|
my $cnf = "/tmp/12345/my.sandbox.cnf";
|
||||||
my $cmd = "$trunk/bin/pt-archiver";
|
my $cmd = "$trunk/bin/pt-archiver";
|
||||||
|
|
||||||
$sb->wipe_clean($dbh);
|
|
||||||
$sb->create_dbs($dbh, ['test']);
|
|
||||||
|
|
||||||
if ( PerconaTest::load_data_is_disabled($dbh) ) {
|
if ( PerconaTest::load_data_is_disabled($dbh) ) {
|
||||||
test_disabled_load_data($dbh, $sb);
|
test_disabled_load_data($dbh, $sb);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
|
$sb->wipe_clean($dbh);
|
||||||
|
$sb->create_dbs($dbh, ['test']);
|
||||||
|
|
||||||
# Test --bulk-insert
|
# Test --bulk-insert
|
||||||
$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`');
|
$dbh->do('INSERT INTO `test`.`table_5_copy` SELECT * FROM `test`.`table_5`');
|
||||||
@@ -113,6 +114,8 @@ is_deeply(
|
|||||||
|
|
||||||
sub test_disabled_load_data {
|
sub test_disabled_load_data {
|
||||||
my ($dbh, $sb) = @_;
|
my ($dbh, $sb) = @_;
|
||||||
|
$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`');
|
$dbh->do('INSERT INTO `test`.`table_5_copy` SELECT * FROM `test`.`table_5`');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user