mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Update all modules in all tools. Remove pt-table-usage. Make update-modules ignore non-Perl tools.
This commit is contained in:
+68
-67
@@ -9,14 +9,14 @@ use warnings FATAL => 'all';
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
# ###########################################################################
|
||||
# DSNParser package 7388
|
||||
# DSNParser package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/DSNParser.pm
|
||||
# trunk/common/t/DSNParser.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/DSNParser.pm
|
||||
# t/lib/DSNParser.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
{
|
||||
package DSNParser;
|
||||
|
||||
use strict;
|
||||
@@ -33,7 +33,6 @@ eval {
|
||||
};
|
||||
my $have_dbi = $EVAL_ERROR ? 0 : 1;
|
||||
|
||||
|
||||
sub new {
|
||||
my ( $class, %args ) = @_;
|
||||
foreach my $arg ( qw(opts) ) {
|
||||
@@ -230,8 +229,8 @@ sub get_dbh {
|
||||
my $dbh;
|
||||
my $tries = 2;
|
||||
while ( !$dbh && $tries-- ) {
|
||||
MKDEBUG && _d($cxn_string, ' ', $user, ' ', $pass, ' {',
|
||||
join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ), '}');
|
||||
MKDEBUG && _d($cxn_string, ' ', $user, ' ', $pass,
|
||||
join(', ', map { "$_=>$defaults->{$_}" } keys %$defaults ));
|
||||
|
||||
eval {
|
||||
$dbh = DBI->connect($cxn_string, $user, $pass, $defaults);
|
||||
@@ -360,28 +359,28 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End DSNParser package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# OptionParser package 7102
|
||||
# OptionParser package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/OptionParser.pm
|
||||
# trunk/common/t/OptionParser.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/OptionParser.pm
|
||||
# t/lib/OptionParser.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
{
|
||||
package OptionParser;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use List::Util qw(max);
|
||||
use English qw(-no_match_vars);
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
use List::Util qw(max);
|
||||
use Getopt::Long;
|
||||
|
||||
my $POD_link_re = '[LC]<"?([^">]+)"?>';
|
||||
@@ -431,9 +430,9 @@ sub new {
|
||||
defaults_to => {}, # rule: opt defaults to value of other opt
|
||||
DSNParser => undef,
|
||||
default_files => [
|
||||
"/etc/maatkit/maatkit.conf",
|
||||
"/etc/maatkit/$program_name.conf",
|
||||
"$home/.maatkit.conf",
|
||||
"/etc/percona-toolkit/percona-toolkit.conf",
|
||||
"/etc/percona-toolkit/$program_name.conf",
|
||||
"$home/.percona-toolkit.conf",
|
||||
"$home/.$program_name.conf",
|
||||
],
|
||||
types => {
|
||||
@@ -1381,26 +1380,25 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End OptionParser package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# Quoter package 6850
|
||||
# Quoter package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/Quoter.pm
|
||||
# trunk/common/t/Quoter.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/Quoter.pm
|
||||
# t/lib/Quoter.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
{
|
||||
package Quoter;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
sub new {
|
||||
@@ -1459,26 +1457,25 @@ sub join_quote {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Quoter package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# VersionParser package 6667
|
||||
# VersionParser package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/VersionParser.pm
|
||||
# trunk/common/t/VersionParser.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/VersionParser.pm
|
||||
# t/lib/VersionParser.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
{
|
||||
package VersionParser;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
sub new {
|
||||
@@ -1543,32 +1540,32 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End VersionParser package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# TableParser package 7156
|
||||
# TableParser package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/TableParser.pm
|
||||
# trunk/common/t/TableParser.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/TableParser.pm
|
||||
# t/lib/TableParser.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
{
|
||||
package TableParser;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
use Data::Dumper;
|
||||
$Data::Dumper::Indent = 1;
|
||||
$Data::Dumper::Sortkeys = 1;
|
||||
$Data::Dumper::Quotekeys = 0;
|
||||
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
sub new {
|
||||
my ( $class, %args ) = @_;
|
||||
my @required_args = qw(Quoter);
|
||||
@@ -1859,6 +1856,7 @@ sub get_keys {
|
||||
|
||||
sub get_fks {
|
||||
my ( $self, $ddl, $opts ) = @_;
|
||||
my $q = $self->{Quoter};
|
||||
my $fks = {};
|
||||
|
||||
foreach my $fk (
|
||||
@@ -1868,17 +1866,22 @@ sub get_fks {
|
||||
my ( $cols ) = $fk =~ m/FOREIGN KEY \(([^\)]+)\)/;
|
||||
my ( $parent, $parent_cols ) = $fk =~ m/REFERENCES (\S+) \(([^\)]+)\)/;
|
||||
|
||||
my ($db, $tbl) = $q->split_unquote($parent, $opts->{database});
|
||||
my %parent_tbl = (tbl => $tbl);
|
||||
$parent_tbl{db} = $db if $db;
|
||||
|
||||
if ( $parent !~ m/\./ && $opts->{database} ) {
|
||||
$parent = "`$opts->{database}`.$parent";
|
||||
$parent = $q->quote($opts->{database}) . ".$parent";
|
||||
}
|
||||
|
||||
$fks->{$name} = {
|
||||
name => $name,
|
||||
colnames => $cols,
|
||||
cols => [ map { s/[ `]+//g; $_; } split(',', $cols) ],
|
||||
parent_tbl => $parent,
|
||||
parent_colnames=> $parent_cols,
|
||||
parent_tbl => \%parent_tbl,
|
||||
parent_tblname => $parent,
|
||||
parent_cols => [ map { s/[ `]+//g; $_; } split(',', $parent_cols) ],
|
||||
parent_colnames=> $parent_cols,
|
||||
ddl => $fk,
|
||||
};
|
||||
}
|
||||
@@ -1938,26 +1941,25 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End TableParser package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# MySQLDump package 6345
|
||||
# MySQLDump package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/MySQLDump.pm
|
||||
# trunk/common/t/MySQLDump.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/MySQLDump.pm
|
||||
# t/lib/MySQLDump.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
{
|
||||
package MySQLDump;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
( our $before = <<'EOF') =~ s/^ //gm;
|
||||
@@ -2244,29 +2246,28 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End MySQLDump package
|
||||
# ###########################################################################
|
||||
|
||||
# ###########################################################################
|
||||
# Daemon package 6255
|
||||
# Daemon package
|
||||
# This package is a copy without comments from the original. The original
|
||||
# with comments and its test file can be found in the SVN repository at,
|
||||
# trunk/common/Daemon.pm
|
||||
# trunk/common/t/Daemon.t
|
||||
# See http://code.google.com/p/maatkit/wiki/Developers for more information.
|
||||
# with comments and its test file can be found in the Bazaar repository at,
|
||||
# lib/Daemon.pm
|
||||
# t/lib/Daemon.t
|
||||
# See https://launchpad.net/percona-toolkit for more information.
|
||||
# ###########################################################################
|
||||
|
||||
{
|
||||
package Daemon;
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
use POSIX qw(setsid);
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
use constant MKDEBUG => $ENV{MKDEBUG} || 0;
|
||||
|
||||
sub new {
|
||||
my ( $class, %args ) = @_;
|
||||
@@ -2431,7 +2432,7 @@ sub _d {
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Daemon package
|
||||
# ###########################################################################
|
||||
|
||||
Reference in New Issue
Block a user