Commit 1ebd29ac authored by monty@tik.mysql.fi's avatar monty@tik.mysql.fi

merge

parents 79e467f0 768deddc
...@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) { ...@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) {
my $db = $rdb->{src}; my $db = $rdb->{src};
eval { $dbh->do( "use $db" ); }; eval { $dbh->do( "use $db" ); };
die "Database '$db' not accessible: $@" if ( $@ ); die "Database '$db' not accessible: $@" if ( $@ );
my @dbh_tables = $dbh->func( '_ListTables' ); my @dbh_tables = $dbh->tables();
## generate regex for tables/files ## generate regex for tables/files
my $t_regex = $rdb->{t_regex}; ## assign temporary regex my $t_regex;
my $negated = $t_regex =~ tr/~//d; ## remove and count negation operator: we don't allow ~ in table names my $negated;
$t_regex = qr/$t_regex/; ## make regex string from user regex if ($rdb->{t_regex}) {
$t_regex = $rdb->{t_regex}; ## assign temporary regex
## filter (out) tables specified in t_regex $negated = $t_regex =~ tr/~//d; ## remove and count
print "Filtering tables with '$t_regex'\n" if $opt{debug}; ## negation operator: we
@dbh_tables = ( $negated ## don't allow ~ in table
? grep { $_ !~ $t_regex } @dbh_tables ## names
: grep { $_ =~ $t_regex } @dbh_tables );
$t_regex = qr/$t_regex/; ## make regex string from
## user regex
## filter (out) tables specified in t_regex
print "Filtering tables with '$t_regex'\n" if $opt{debug};
@dbh_tables = ( $negated
? grep { $_ !~ $t_regex } @dbh_tables
: grep { $_ =~ $t_regex } @dbh_tables );
}
## get list of files to copy ## get list of files to copy
my $db_dir = "$datadir/$db"; my $db_dir = "$datadir/$db";
...@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) { ...@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) {
closedir( DBDIR ); closedir( DBDIR );
## filter (out) files specified in t_regex ## filter (out) files specified in t_regex
my @db_files = ( $negated my @db_files;
? grep { $db_files{$_} !~ $t_regex } keys %db_files if ($rdb->{t_regex}) {
: grep { $db_files{$_} =~ $t_regex } keys %db_files ); @db_files = ($negated
? grep { $db_files{$_} !~ $t_regex } keys %db_files
: grep { $db_files{$_} =~ $t_regex } keys %db_files );
}
else {
@db_files = keys %db_files;
}
@db_files = sort @db_files; @db_files = sort @db_files;
my @index_files=(); my @index_files=();
## remove indices unless we're told to keep them ## remove indices unless we're told to keep them
...@@ -809,3 +826,7 @@ Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. ...@@ -809,3 +826,7 @@ Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
Emil S. Hansen - Added resetslave and resetmaster. Emil S. Hansen - Added resetslave and resetmaster.
Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which
resulted in nothing being copied when a regexp was specified but no
database name(s).
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment