Implement version-check in the remaining tools.

This commit is contained in:
Daniel Nichter
2012-08-21 16:24:29 -06:00
parent ee583ba729
commit 50f218a288
6 changed files with 62 additions and 8 deletions

View File

@@ -12852,8 +12852,8 @@ my $ps_dbh; # For Processlist
my $aux_dbh; # For --aux-dsn (--since/--until "MySQL expression")
sub main {
@ARGV = @_; # set global ARGV for this package
$oktorun = 1; # reset between tests else pipeline won't run
local @ARGV = @_; # set global ARGV for this package
$oktorun = 1; # reset between tests else pipeline won't run
# ##########################################################################
# Get configuration information.
@@ -14154,6 +14154,14 @@ sub main {
$daemon->make_PID_file();
}
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($qv_dbh || $ps_dbh || $ex_dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# ##########################################################################
# Parse the input.
# ##########################################################################

View File

@@ -3460,9 +3460,9 @@ my $o;
my $oktorun = 1;
sub main {
@ARGV = @_; # set global ARGV for this package
local @ARGV = @_; # set global ARGV for this package
$o = new OptionParser();
$o = new OptionParser();
$o->get_specs();
$o->get_opts();
@@ -3535,6 +3535,14 @@ sub main {
$daemon->make_PID_file();
}
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($slave_dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# If the I/O thread isn't running when the program starts,
# it never knows what to do. So start it.
$slave_dbh->do('START SLAVE IO_THREAD');

View File

@@ -4085,7 +4085,7 @@ my $q = new Quoter();
my %children;
sub main {
@ARGV = @_; # set global ARGV for this package
local @ARGV = @_; # set global ARGV for this package
# ########################################################################
# Get configuration information.
@@ -4153,7 +4153,7 @@ sub main {
}
# ########################################################################
# Connect and go to work.
# Connect to MySQL.
# ########################################################################
if ( $o->get('ask-pass') ) {
$o->set('password', OptionParser::prompt_noecho("Enter password: "));
@@ -4179,6 +4179,17 @@ sub main {
$daemon->make_PID_file();
}
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# ########################################################################
# Start monitoring the slave.
# ########################################################################
my $exit_status = 0;
my @servers_to_watch;

View File

@@ -9430,6 +9430,17 @@ sub main {
}
}
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dsns[0]->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# ########################################################################
# Sync!
# ########################################################################
my %args = (
dsns => \@dsns,
plugins => $plugins,

View File

@@ -11290,7 +11290,7 @@ use sigtrap 'handler', \&sig_int, 'normal-signals';
my $oktorun = 1;
sub main {
@ARGV = @_; # set global ARGV for this package
local @ARGV = @_; # set global ARGV for this package
# ##########################################################################
# Get configuration information.
@@ -11597,6 +11597,14 @@ sub main {
return $event;
};
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($hosts->[0]->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# ########################################################################
# Short version: do it! Long version: this callback does the main work.
# The big picture is:

View File

@@ -4366,7 +4366,7 @@ use Percona::Toolkit;
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
sub main {
@ARGV = @_; # set global ARGV for this package
local @ARGV = @_; # set global ARGV for this package
# ########################################################################
# Get configuration information.
@@ -4461,6 +4461,14 @@ sub main {
$daemon->make_PID_file();
}
# ########################################################################
# Do the version-check
# ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
}
# #########################################################################
# Get the variables and other MySQL info to pass to rules.
# #########################################################################