summaryrefslogtreecommitdiff
path: root/scripts/mysqlhotcopy.sh
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.fi>2001-07-28 13:29:20 +0300
committerunknown <monty@tik.mysql.fi>2001-07-28 13:29:20 +0300
commite7eb74372cd792c52754068127981e0e2f604aa8 (patch)
treef49b5792279004de8ba1c79238ce7ab830e16350 /scripts/mysqlhotcopy.sh
parentdece009c8b84f6ee60cf43e32931debc361b932c (diff)
downloadmariadb-git-e7eb74372cd792c52754068127981e0e2f604aa8.tar.gz
Updated LOCK TABLES manual section
Applied patch for mysqlhotcopy Fixed open-files-size option in safe_mysqld Docs/manual.texi: Updated LOCK TABLES section scripts/mysqlhotcopy.sh: Removed depricated DBI calls. Fixed bug which resulted in nothing being copied when a regexp was specified but no database name(s). Patch by Jeremy D. Zawodny scripts/safe_mysqld.sh: Fixed open-files-size option
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-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).
+