Remove MySQLDump; move get_create_table() and get_table_status() to TableParser and remove saving results in each function.

This commit is contained in:
Daniel Nichter
2011-09-15 09:39:32 -06:00
parent d5eb621333
commit 756142c1d1
22 changed files with 177 additions and 727 deletions

View File

@@ -42,7 +42,7 @@ $Data::Dumper::Quotekeys = 0;
sub new {
my ( $class, %args ) = @_;
my @required_args = qw(method base-dir plugins get_id
QueryParser MySQLDump TableParser TableSyncer Quoter);
QueryParser TableParser TableSyncer Quoter);
foreach my $arg ( @required_args ) {
die "I need a $arg argument" unless $args{$arg};
}
@@ -767,7 +767,6 @@ sub add_indexes {
my $qp = $self->{QueryParser};
my $tp = $self->{TableParser};
my $q = $self->{Quoter};
my $du = $self->{MySQLDump};
my @src_tbls = $qp->get_tables($query);
my @keys;
@@ -777,8 +776,11 @@ sub add_indexes {
my $tbl_struct;
eval {
$tbl_struct = $tp->parse(
$du->get_create_table($dsts->[0]->{dbh}, $q, $db, $tbl)
);
$tp->get_create_table(
dbh => $dsts->[0]->{dbh},
db => $db,
tbl => $tbl,
));
};
if ( $EVAL_ERROR ) {
MKDEBUG && _d('Error parsing', $db, '.', $tbl, ':', $EVAL_ERROR);