Add t/pt-archiver/version_check.t, v-c integration tests. Don't exit early if PTDEBUG && PTVCDEBUG (don't know what state the tool may be in).

This commit is contained in:
Daniel Nichter
2012-08-22 16:20:00 -06:00
parent 66f1bdf403
commit 639f47eb70
21 changed files with 403 additions and 219 deletions

View File

@@ -4593,17 +4593,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -4617,13 +4619,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -5293,7 +5296,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($src->{dbh}); Pingback::version_check($src->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -3695,17 +3695,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -3719,13 +3721,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -3977,7 +3980,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($configs[0]->{dbh}); Pingback::version_check($configs[0]->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################### # #########################################################################

View File

@@ -3152,17 +3152,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -3176,13 +3178,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -3502,7 +3505,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -4265,17 +4265,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -4289,13 +4291,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -4484,7 +4487,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check(); Pingback::version_check();
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -4109,17 +4109,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -4133,13 +4135,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -4355,7 +4358,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ####################################################################### # #######################################################################

View File

@@ -2949,17 +2949,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -2973,13 +2975,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -3523,7 +3526,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -2856,17 +2856,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -2880,13 +2882,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -3147,7 +3150,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -4033,17 +4033,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -4057,13 +4059,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -4643,7 +4646,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -5616,17 +5616,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -5640,13 +5642,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -5986,7 +5989,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -5613,17 +5613,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -5637,13 +5639,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -6135,7 +6138,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -6635,17 +6635,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -6659,13 +6661,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -7029,7 +7032,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($cxn->dbh()); Pingback::version_check($cxn->dbh());
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -6798,17 +6798,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -6822,13 +6824,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -7362,7 +7365,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################### # #########################################################################

View File

@@ -12647,17 +12647,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -12671,13 +12673,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -14160,7 +14163,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($qv_dbh || $ps_dbh || $ex_dbh); Pingback::version_check($qv_dbh || $ps_dbh || $ex_dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ########################################################################## # ##########################################################################

View File

@@ -3266,17 +3266,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -3290,13 +3292,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -3541,7 +3544,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($slave_dbh); Pingback::version_check($slave_dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# If the I/O thread isn't running when the program starts, # If the I/O thread isn't running when the program starts,

View File

@@ -3888,17 +3888,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -3912,13 +3914,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -4185,7 +4188,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -817,17 +817,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -841,13 +843,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -8033,7 +8036,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($master_dbh); Pingback::version_check($master_dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -9037,17 +9037,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -9061,13 +9063,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -9436,7 +9439,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dsns[0]->{dbh}); Pingback::version_check($dsns[0]->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -11090,17 +11090,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -11114,13 +11116,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -11603,7 +11606,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($hosts->[0]->{dbh}); Pingback::version_check($hosts->[0]->{dbh});
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################## # ########################################################################

View File

@@ -4178,17 +4178,19 @@ eval {
sub version_check { sub version_check {
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -4202,13 +4204,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;
@@ -4467,7 +4470,6 @@ sub main {
# ######################################################################## # ########################################################################
if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) { if ( $o->get('version-check') && ($o->has('quiet') && !$o->get('quiet')) ) {
Pingback::version_check($dbh); Pingback::version_check($dbh);
return 0 if $ENV{PTVCDEBUG} && PTDEBUG;
} }
# ######################################################################### # #########################################################################

View File

@@ -58,17 +58,19 @@ sub version_check {
# get in the way of the tool's real work. # get in the way of the tool's real work.
eval { eval {
if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) { if (exists $ENV{PERCONA_VERSION_CHECK} && !$ENV{PERCONA_VERSION_CHECK}) {
PTDEBUG && _d('--version-check is disabled by PERCONA_VERSION_CHECK'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('--version-check is disabled by the', _d('--version-check is disabled by the PERCONA_VERSION_CHECK',
'PERCONA_VERSION_CHECK environment variable'); 'environment variable');
}
return; return;
} }
if ( !time_to_check($check_time_file) ) { if ( !time_to_check($check_time_file) ) {
PTDEBUG && _d('Not time to do --version-check'); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('It is not time to --version-checka again;', _d('It is not time to --version-checka again;',
'only 1 check per', $check_time_limit, 'seconds, and the last', 'only 1 check per', $check_time_limit, 'seconds, and the last',
'check was performed on the modified time of', $check_time_file); 'check was performed on the modified time of', $check_time_file);
}
return; return;
} }
@@ -82,13 +84,14 @@ sub version_check {
print join("\n", map { "# * $_" } @$advice); print join("\n", map { "# * $_" } @$advice);
print "\n# Specify --no-version-check to disable these suggestions.\n\n"; print "\n# Specify --no-version-check to disable these suggestions.\n\n";
} }
elsif ( $ENV{PTVCDEBUG} ) { elsif ( $ENV{PTVCDEBUG} || PTDEBUG ) {
_d('--version-check worked, but there were no suggestions'); _d('--version-check worked, but there were no suggestions');
} }
}; };
if ( $EVAL_ERROR ) { if ( $EVAL_ERROR ) {
PTDEBUG && _d('Error doing --version-check:', $EVAL_ERROR); if ( $ENV{PTVCDEBUG} || PTDEBUG ) {
$ENV{PTVCDEBUG} && _d('Error doing --version-check:', $EVAL_ERROR); _d('Error doing --version-check:', $EVAL_ERROR);
}
} }
return; return;

View File

@@ -0,0 +1,143 @@
#!/usr/bin/env perl
BEGIN {
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
};
use strict;
use warnings FATAL => 'all';
use English qw(-no_match_vars);
use Test::More;
use PerconaTest;
use Sandbox;
use Data::Dumper;
use File::Spec;
use Time::HiRes qw(time);
require "$trunk/bin/pt-archiver";
# PerconaTest.pm sets this because normal tests shouldn't v-c.
delete $ENV{PERCONA_VERSION_CHECK};
my $dp = new DSNParser(opts=>$dsn_opts);
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
my $master_dbh = $sb->get_dbh_for('master');
if ( !$master_dbh ) {
plan skip_all => 'Cannot connect to sandbox master';
}
my $rows;
my $output;
my $cnf = "/tmp/12345/my.sandbox.cnf";
my $cmd = "$trunk/bin/pt-archiver";
my @args = qw(--dry-run --where 1=1);
# Pingback.pm does this too.
my $dir = File::Spec->tmpdir();
my $check_time_file = File::Spec->catfile($dir,'percona-toolkit-version-check');
unlink $check_time_file if -f $check_time_file;
$sb->create_dbs($master_dbh, ['test']);
$sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql');
$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`;
like(
$output,
qr/(?:VersionCheck|Pingback|Percona suggests)/,
"Looks like the version-check happened"
) or diag($output);
$rows = $master_dbh->selectall_arrayref("SELECT * FROM test.table_1");
is_deeply(
$rows,
[],
"Tool ran after version-check"
) or diag(Dumper($rows));
ok(
-f $check_time_file,
"Created percona-toolkit-version-check file"
);
# ###########################################################################
# v-c file should limit checks to 1 per 24 hours
# ###########################################################################
$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`;
like(
$output,
qr/It is not time to --version-checka again/,
"Doesn't always check because of time limit"
);
unlink $check_time_file if -f $check_time_file;
# ###########################################################################
# Fake v.percona.com not responding by using a different, non-existent URL.
# ###########################################################################
my $t0 = time;
$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK_URL='http://x.percona.com' $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`;
my $t = time - $t0;
like(
$output,
qr/Error.+?GET http:\/\/x\.percona\.com.+?HTTP status 5\d+/,
"The Percona server didn't respond"
);
# In actuality it should only wait 2s, but on slow boxes all the other
# stuff the tool does may cause the time to be much greater than 2.
# If nothing else, this tests that the timeout isn't something crazy
# like 30s.
cmp_ok(
$t,
'<',
6,
"Tool waited a short while for the Percona server to respond"
);
# ###########################################################################
# Disable the v-c.
# ###########################################################################
unlink $check_time_file if -f $check_time_file;
$output = `PTVCDEBUG=1 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge --no-version-check 2>&1`;
unlike(
$output,
qr/(?:VersionCheck|Pingback|Percona suggests)/,
"Looks like --no-version-check disabled the version-check"
) or diag($output);
ok(
!-f $check_time_file,
"percona-toolkit-version-check file not created with --no-version-check"
);
# PERCONA_VERSION_CHECK=0 is handled in Pingback, so it will print a line
# for PTVCDEBUG saying why it didn't run. So we just check that it doesn't
# create the file which also signifies that it didn't run.
$output = `PTVCDEBUG=1 PERCONA_VERSION_CHECK=0 $cmd --source F=$cnf,D=test,t=table_1 --where 1=1 --purge 2>&1`;
ok(
!-f $check_time_file,
"Looks like PERCONA_VERSION_CHECK=0 disabled the version-check"
);
# #############################################################################
# Done.
# #############################################################################
unlink $check_time_file if -f $check_time_file;
$sb->wipe_clean($master_dbh);
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
done_testing;
exit;