mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Don't re-use same db in use_repl_db().
This commit is contained in:
@@ -5233,6 +5233,9 @@ sub check_repl_table {
|
||||
# won't pass a tbl arg because they're just doing something to
|
||||
# the --replicate table.
|
||||
# See http://code.google.com/p/maatkit/issues/detail?id=982
|
||||
{
|
||||
my $current_db;
|
||||
|
||||
sub use_repl_db {
|
||||
my ( %args ) = @_;
|
||||
my @required_args = qw(dbh repl_table OptionParser Quoter);
|
||||
@@ -5255,6 +5258,7 @@ sub use_repl_db {
|
||||
$db = $o->get('replicate-database') if $o->get('replicate-database');
|
||||
}
|
||||
|
||||
if ( !$current_db || $current_db ne $db ) {
|
||||
eval {
|
||||
my $sql = "USE " . $q->quote($db);
|
||||
MKDEBUG && _d($sql);
|
||||
@@ -5271,9 +5275,12 @@ sub use_repl_db {
|
||||
die "Error using $opt `$db`: $EVAL_ERROR";
|
||||
}
|
||||
}
|
||||
$current_db = $db;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
sub create_repl_table {
|
||||
my ( %args ) = @_;
|
||||
|
Reference in New Issue
Block a user