From 07810ca8678defd8136aca30d32ef3e7ba4569dc Mon Sep 17 00:00:00 2001 From: Daniel Nichter Date: Wed, 13 Feb 2013 16:06:31 -0700 Subject: [PATCH] Change --version-check to --[no]version-check, update POD text and how version_check() is called. --- bin/pt-archiver | 39 +++++++++------------- bin/pt-config-diff | 37 +++++++++----------- bin/pt-deadlock-logger | 38 +++++++++------------ bin/pt-diskstats | 38 +++++++++------------ bin/pt-duplicate-key-checker | 39 +++++++++------------- bin/pt-find | 40 +++++++++------------- bin/pt-fk-error-logger | 38 +++++++++------------ bin/pt-heartbeat | 40 +++++++++------------- bin/pt-index-usage | 38 +++++++++------------ bin/pt-kill | 38 +++++++++------------ bin/pt-online-schema-change | 46 ++++++++++++------------- bin/pt-query-advisor | 38 +++++++++------------ bin/pt-query-digest | 38 +++++++++------------ bin/pt-slave-delay | 48 ++++++++++++-------------- bin/pt-slave-restart | 42 ++++++++++------------- bin/pt-table-checksum | 38 +++++++++------------ bin/pt-table-sync | 65 ++++++++++++++++-------------------- bin/pt-upgrade | 46 ++++++++++++------------- bin/pt-variable-advisor | 38 +++++++++------------ 19 files changed, 324 insertions(+), 460 deletions(-) diff --git a/bin/pt-archiver b/bin/pt-archiver index 6bebc4b4..8cc2558b 100755 --- a/bin/pt-archiver +++ b/bin/pt-archiver @@ -5408,9 +5408,6 @@ sub main { if ( $bulk_del && $limit < 2 ) { $o->save_error("--bulk-delete is meaningless with --limit 1"); } - - VersionCheck::validate_options($o); - } if ( $bulk_del || $o->get('bulk-insert') ) { @@ -5808,13 +5805,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $src->{dbh}, dsn => $src->{dsn} }, ( $dst ? { dbh => $dst->{dbh}, dsn => $dst->{dsn} } : () ), ], - protocol => $o->get('version-check'), ); } @@ -7284,30 +7280,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --where diff --git a/bin/pt-config-diff b/bin/pt-config-diff index 188d6627..cb7b55bd 100755 --- a/bin/pt-config-diff +++ b/bin/pt-config-diff @@ -4991,7 +4991,6 @@ sub main { if ( @ARGV < 1 ) { $o->save_error("Specify at least one file or DSN on the command line"); } - VersionCheck::validate_options($o); } $o->usage_or_errors(); @@ -5067,10 +5066,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ map({ +{ dbh => $_->dbh, dsn => $_->dsn } } @cxn) ], - protocol => $o->get('version-check'), ); } @@ -5358,30 +5356,25 @@ MySQL user if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-deadlock-logger b/bin/pt-deadlock-logger index 8f3308c1..57f77005 100755 --- a/bin/pt-deadlock-logger +++ b/bin/pt-deadlock-logger @@ -3978,8 +3978,6 @@ sub main { $o->save_error("--dest requires a 't' (table) part"); } - VersionCheck::validate_options($o); - # Avoid running forever with zero second interval. if ( $o->get('run-time') && !$o->get('interval') ) { $o->set('interval', 1); @@ -4049,13 +4047,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $dbh, dsn => $source_dsn }, ($dest_dsn ? { dbh => $dest_dsn, dsn => $dest_dsn } : ()), ], - protocol => $o->get('version-check'), ); } @@ -4748,30 +4745,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-diskstats b/bin/pt-diskstats index c011fdb7..044eb3ff 100755 --- a/bin/pt-diskstats +++ b/bin/pt-diskstats @@ -4803,7 +4803,6 @@ sub main { if ( !$o->get('columns-regex') ) { $o->save_error("A regex pattern for --column-regex must be specified"); } - VersionCheck::validate_options($o); } $o->usage_or_errors(); @@ -4811,8 +4810,8 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { - VersionCheck::version_check(protocol => $o->get('version-check')); + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { + VersionCheck::version_check(); } # ######################################################################## @@ -5401,30 +5400,25 @@ aggregated into one line, the first timestamp is shown. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-duplicate-key-checker b/bin/pt-duplicate-key-checker index a9a1ec70..909e080e 100755 --- a/bin/pt-duplicate-key-checker +++ b/bin/pt-duplicate-key-checker @@ -4668,8 +4668,7 @@ sub main { my $dp = $o->DSNParser(); $dp->prop('set-vars', $o->get('set-vars')); - VersionCheck::validate_options($o); - + $o->usage_or_errors(); # ######################################################################## @@ -4699,10 +4698,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ {dbh => $dbh, dsn => $dsn} ], - protocol => $o->get('version-check'), ); } @@ -5204,30 +5202,25 @@ Output all keys and/or foreign keys found, not just redundant ones. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-find b/bin/pt-find index fc5f73a0..58b126f8 100755 --- a/bin/pt-find +++ b/bin/pt-find @@ -3739,8 +3739,6 @@ sub main { $o->save_error("--server-id regex doesn't capture digits with (\\d+)"); } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # Interpolate strings for printf and exec. At the same time discover whether @@ -3840,10 +3838,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( - instances => [{dbh => $dbh, dsn => $dsn}], - protocol => $o->get('version-check'), + instances => [ { dbh => $dbh, dsn => $dsn } ], ); } @@ -4294,30 +4291,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-fk-error-logger b/bin/pt-fk-error-logger index 59592687..8f9a724e 100755 --- a/bin/pt-fk-error-logger +++ b/bin/pt-fk-error-logger @@ -3437,8 +3437,6 @@ sub main { if ( $dst_dsn && !$dst_dsn->{t} ) { $o->save_error("--dest requires a 't' (table) part"); } - - VersionCheck::validate_options($o); } $o->usage_or_errors(); @@ -3499,13 +3497,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $dbh, dsn => $src_dsn }, ($dst_dbh ? { dbh => $dst_dbh, dsn => $dst_dsn } : ()) ], - protocol => $o->get('version-check'), ); } @@ -3797,30 +3794,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-heartbeat b/bin/pt-heartbeat index 008801af..4e9cda7f 100755 --- a/bin/pt-heartbeat +++ b/bin/pt-heartbeat @@ -4692,8 +4692,6 @@ sub main { $o->save_error("Invalid --recursion-method: $EVAL_ERROR") } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -5071,10 +5069,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( - instances => [ {dbh => $dbh, dsn => $dsn} ], - protocol => $o->get('version-check'), + instances => [ { dbh => $dbh, dsn => $dsn } ], ); } @@ -5828,30 +5825,25 @@ is running on a system that uses UTC). Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-index-usage b/bin/pt-index-usage index 9c030c34..dd4ac9a3 100755 --- a/bin/pt-index-usage +++ b/bin/pt-index-usage @@ -6135,8 +6135,6 @@ sub main { . "--save-results-database DSN"); } } - - VersionCheck::validate_options($o); } $o->usage_or_errors(); @@ -6280,13 +6278,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $dbh, dsn => $dsn }, ($res_dbh ? { dbh => $res_dbh, dsn => $res_dsn } : ()) ], - protocol => $o->get('version-check'), ); } @@ -7199,30 +7196,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-kill b/bin/pt-kill index d73cdb71..9a0206a7 100755 --- a/bin/pt-kill +++ b/bin/pt-kill @@ -6371,8 +6371,6 @@ sub main { $o->save_error("Invalid value for --victims: $victims"); } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -6653,10 +6651,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ ($dbh ? { dbh => $dbh, dsn => $cxn->dsn() } : ()) ], - protocol => $o->get('version-check'), ); } @@ -7385,30 +7382,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --victims diff --git a/bin/pt-online-schema-change b/bin/pt-online-schema-change index 217429cc..c12a26a5 100755 --- a/bin/pt-online-schema-change +++ b/bin/pt-online-schema-change @@ -7968,8 +7968,6 @@ sub main { $o->save_error("Invalid --recursion-method: $EVAL_ERROR") } - VersionCheck::validate_options($o); - $o->usage_or_errors(); if ( $o->get('quiet') ) { @@ -8257,11 +8255,14 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( - instances => [ map({ +{ dbh => $_->dbh(), dsn => $_->dsn() } } - $cxn, ($slaves ? @$slaves : ())) ], - protocol => $o->get('version-check'), + instances => [ + map ( + { +{ dbh => $_->dbh(), dsn => $_->dsn() } } + $cxn, ($slaves ? @$slaves : ()) + ) + ], ); } @@ -10965,30 +10966,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-query-advisor b/bin/pt-query-advisor index 5803396c..23d66fdb 100755 --- a/bin/pt-query-advisor +++ b/bin/pt-query-advisor @@ -8098,8 +8098,6 @@ sub main { $o->save_error("Invalid --group-by value. Valid values are: " . "rule_id, query_id, none"); } - - VersionCheck::validate_options($o); } $o->usage_or_errors(); @@ -8429,13 +8427,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ ($review_dbh ? { dbh => $review_dbh, dsn => $review_dsn } : ()), ($dbh ? { dbh => $dbh, dsn => $dsn } : ()), ], - protocol => $o->get('version-check'), ); } @@ -9206,30 +9203,25 @@ L<"--report-format">. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --where diff --git a/bin/pt-query-digest b/bin/pt-query-digest index f927070a..5af54d30 100755 --- a/bin/pt-query-digest +++ b/bin/pt-query-digest @@ -13812,8 +13812,6 @@ sub main { $o->save_error($EVAL_ERROR); } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -14901,13 +14899,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ ($qv_dbh ? { dbh => $qv_dbh, dsn => $review_dsn } : ()), ($ps_dbh ? { dbh => $ps_dbh, dsn => $ps_dsn } : ()), ], - protocol => $o->get('version-check'), ); } @@ -17096,30 +17093,25 @@ distinct checksums are treated as equal. Show version and exit. -=item --version-check +tem --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --watch-server diff --git a/bin/pt-slave-delay b/bin/pt-slave-delay index c89d7013..8e672a11 100755 --- a/bin/pt-slave-delay +++ b/bin/pt-slave-delay @@ -4029,8 +4029,6 @@ sub main { $o->set('run-time', max($o->get('run-time'), 1)); } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ####################################################################### @@ -4084,19 +4082,22 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { - my $tmp_master_dsn = $master_dsn - ? $master_dsn - : { h => $status->{master_host}, P => $status->{master_port} }; + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { + my $tmp_master_dsn + = $master_dsn ? $master_dsn + : {h=>$status->{master_host}, P=>$status->{master_port}}; VersionCheck::version_check( instances => [ { dbh => $slave_dbh, dsn => $slave_dsn }, { dbh => $master_dbh, dsn => $tmp_master_dsn } ], - protocol => $o->get('version-check'), ); } + # ######################################################################## + # Main loop + # ######################################################################## + # 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'); @@ -4568,30 +4569,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-slave-restart b/bin/pt-slave-restart index 7b5c6fcb..5a08fa10 100755 --- a/bin/pt-slave-restart +++ b/bin/pt-slave-restart @@ -4665,8 +4665,6 @@ sub main { $o->save_error("Invalid --recursion-method: $EVAL_ERROR") } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -4771,14 +4769,15 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $dbh, dsn => $dsn }, @servers_to_watch ], - protocol => $o->get('version-check'), ); } - + + # ######################################################################## # Watch each server found. + # ######################################################################## my $must_fork = @servers_to_watch > 1; foreach my $host ( @servers_to_watch ) { @@ -5483,30 +5482,25 @@ the current sleep time each time pt-slave-restart sleeps. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back diff --git a/bin/pt-table-checksum b/bin/pt-table-checksum index 530ec3f5..820d85da 100755 --- a/bin/pt-table-checksum +++ b/bin/pt-table-checksum @@ -8648,8 +8648,6 @@ sub main { $o->save_error("Invalid --recursion-method: $EVAL_ERROR") } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -9236,13 +9234,12 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ { dbh => $master_dbh, dsn => $master_dsn }, map({ +{ dbh => $_->dbh(), dsn => $_->dsn() } } @$slaves) ], - protocol => $o->get('version-check'), ); } @@ -11844,30 +11841,25 @@ group: Help Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --where diff --git a/bin/pt-table-sync b/bin/pt-table-sync index 9749b645..a50900c9 100755 --- a/bin/pt-table-sync +++ b/bin/pt-table-sync @@ -9575,8 +9575,6 @@ sub main { $o->save_error("Invalid --recursion-method: $EVAL_ERROR") } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################## @@ -9668,31 +9666,29 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - # This tool has way too many dbhs and doesn't use Cxn, so we have to # manually disconnect them else they'll throw a warning. Also, it # creates some dbh late, so here we need to create a dbh and then # disconnect it only if we created it, i.e. don't disconnect the few # dbh created early by the tool. - my @vc_dbhs; - my @instances = map { - my $dsn = $_; - my $dbh = $dsn->{dbh}; - if ( !$dbh ) { - $dbh = get_cxn($dsn, %modules); - push @vc_dbhs, $dbh; # disconnect this dbh after version check - } - +{ dbh => $dbh, dsn => $dsn } - } @dsns; + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { + my @vc_dbhs; + my @instances = map { + my $dsn = $_; + my $dbh = $dsn->{dbh}; + if ( !$dbh ) { + $dbh = get_cxn($dsn, %modules); + push @vc_dbhs, $dbh; # disconnect this dbh after version check + } + +{ dbh => $dbh, dsn => $dsn } + } @dsns; - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( - instances => [@instances], - protocol => $o->get('version-check'), + instances => \@instances, ); - } - map { $_->disconnect } @vc_dbhs; # disconnect dbh created for version check + map { $_->disconnect } @vc_dbhs; + } # ######################################################################## # Sync! @@ -12248,30 +12244,25 @@ See L<"OUTPUT"> for more details about the output. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --wait diff --git a/bin/pt-upgrade b/bin/pt-upgrade index 75f9b661..50b3087d 100755 --- a/bin/pt-upgrade +++ b/bin/pt-upgrade @@ -12340,8 +12340,6 @@ sub main { $o->save_error('Specify at least one host DSN'); } - VersionCheck::validate_options($o); - $o->usage_or_errors(); if ( $o->get('explain-hosts') ) { @@ -12603,11 +12601,14 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' - && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( - instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ], - protocol => $o->get('version-check'), + instances => [ + map( + { +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } + @$hosts + ) + ], ); } @@ -13579,30 +13580,25 @@ User for login if not current user. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =item --zero-query-times diff --git a/bin/pt-variable-advisor b/bin/pt-variable-advisor index 7fe3aadc..9fb9c7f1 100755 --- a/bin/pt-variable-advisor +++ b/bin/pt-variable-advisor @@ -4929,8 +4929,6 @@ sub main { } } - VersionCheck::validate_options($o); - $o->usage_or_errors(); # ######################################################################### @@ -5005,10 +5003,9 @@ sub main { # ######################################################################## # Do the version-check # ######################################################################## - if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { + if ( $o->get('version-check') && (!$o->has('quiet') || !$o->get('quiet')) ) { VersionCheck::version_check( instances => [ ($dbh ? { dbh => $dbh, dsn => $dsn } : ()) ], - protocol => $o->get('version-check'), ); } @@ -5835,30 +5832,25 @@ higher levels, the program prints more of the description. Show version and exit. -=item --version-check +=item --[no]version-check -type: string; default: off +default: yes -Send program versions to Percona and print suggested upgrades and problems. -Possible values for --version-check: +Check for the latest version of Percona Toolkit, MySQL, and other programs. -=for comment ignore-pt-internal-value -MAGIC_version_check +This is a standard "check for updates automatically" feature, with two +additional features. First, the tool checks the version of other programs +on the local system in addition to its own version. For example, it checks +the version of every MySQL server it connects to, Perl, and the Perl module +DBD::mysql. Second, it checks for and warns about versions with known +problems. For example, MySQL 5.5.25 had a critical bug and was re-released +as 5.5.25a. -https, http, auto, off +Any updates or known problems are printed to STDOUT before the tool's normal +output. This feature should never interfere with the normal operation of the +tool. -C first tries using C, and resorts to C if that fails. -Keep in mind that C might not be available if -C is not installed on your system, although -C<--version-check http> should work everywhere. - -The version check feature causes the tool to send and receive data from -Percona over the web. The data contains program versions from the local -machine. Percona uses the data to focus development on the most widely -used versions of programs, and to suggest to customers possible upgrades -and known bad versions of programs. - -For more information, visit L. +For more information, visit L. =back