summaryrefslogtreecommitdiff
path: root/scripts/mysqlhotcopy.sh
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-01-27 14:29:06 -0800
committerjimw@mysql.com <>2005-01-27 14:29:06 -0800
commit3229e67a20510d11ccdfffb6da8a8697de25b451 (patch)
tree2ae13ca3fc6a4aa5a61305a01b65730e09766338 /scripts/mysqlhotcopy.sh
parent7454f2f09769665afd59c53b49e1bf62454f0672 (diff)
downloadmariadb-git-3229e67a20510d11ccdfffb6da8a8697de25b451.tar.gz
Fix handling of table-name matching in mysqlhotcopy when newer versions of
DBD::mysql that quote table names are used by removing the quoting. Also fix a bug that stripped all '~' characters out of the table regex instead of just the leading one used to negate the expression. (Bug #8136)
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-rw-r--r--scripts/mysqlhotcopy.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 2cfe91da115..e3f4fdaf3ee 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -272,10 +272,7 @@ foreach my $rdb ( @db_desc ) {
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
+ $negated = $t_regex =~ s/^~//; ## note and remove negation operator
$t_regex = qr/$t_regex/; ## make regex string from
## user regex
@@ -820,6 +817,13 @@ sub get_list_of_tables {
});
my @dbh_tables = eval { $dbh->tables() };
+
+ ## Remove quotes around table names
+ my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR
+ if ($quote) {
+ foreach (@dbh_tables) { s/^$quote(.*)$quote$/$1/; }
+ }
+
$dbh->disconnect();
return @dbh_tables;
}