summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-07-28 23:33:16 +0300
committerunknown <monty@tik.mysql.fi>2001-07-28 23:33:16 +0300
commitc6318e4731ca7a185b74a39ac6fa0e6993677b70 (patch)
tree8266d1ebfc3a8f53e0e54f4826d70603150ea4c8 /scripts
parent29ef9455578c37f5581609171bb1abc7d0410162 (diff)
parente7eb74372cd792c52754068127981e0e2f604aa8 (diff)
downloadmariadb-git-c6318e4731ca7a185b74a39ac6fa0e6993677b70.tar.gz
merge
Docs/manual.texi: merge (need to fix with emacs to get everthing right)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqlhotcopy.sh47
1 files changed, 34 insertions, 13 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 1c26bf8e2d6..71359fa5612 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -223,18 +223,27 @@ foreach my $rdb ( @db_desc ) {
my $db = $rdb->{src};
eval { $dbh->do( "use $db" ); };
die "Database '$db' not accessible: $@" if ( $@ );
- my @dbh_tables = $dbh->func( '_ListTables' );
+ my @dbh_tables = $dbh->tables();
## generate regex for tables/files
- my $t_regex = $rdb->{t_regex}; ## assign temporary regex
- my $negated = $t_regex =~ tr/~//d; ## remove and count negation operator: we don't allow ~ in table names
- $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 );
+ my $t_regex;
+ my $negated;
+ if ($rdb->{t_regex}) {
+ $t_regex = $rdb->{t_regex}; ## assign temporary regex
+ $negated = $t_regex =~ tr/~//d; ## remove and count
+ ## negation operator: we
+ ## don't allow ~ in table
+ ## names
+
+ $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
my $db_dir = "$datadir/$db";
@@ -249,10 +258,18 @@ foreach my $rdb ( @db_desc ) {
closedir( DBDIR );
## filter (out) files specified in t_regex
- my @db_files = ( $negated
- ? grep { $db_files{$_} !~ $t_regex } keys %db_files
- : grep { $db_files{$_} =~ $t_regex } keys %db_files );
+ my @db_files;
+ if ($rdb->{t_regex}) {
+ @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;
+
my @index_files=();
## 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.
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).
+