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)
This commit is contained in:
parent
7454f2f097
commit
3229e67a20
@ -272,10 +272,7 @@ foreach my $rdb ( @db_desc ) {
|
|||||||
my $negated;
|
my $negated;
|
||||||
if ($rdb->{t_regex}) {
|
if ($rdb->{t_regex}) {
|
||||||
$t_regex = $rdb->{t_regex}; ## assign temporary regex
|
$t_regex = $rdb->{t_regex}; ## assign temporary regex
|
||||||
$negated = $t_regex =~ tr/~//d; ## remove and count
|
$negated = $t_regex =~ s/^~//; ## note and remove negation operator
|
||||||
## negation operator: we
|
|
||||||
## don't allow ~ in table
|
|
||||||
## names
|
|
||||||
|
|
||||||
$t_regex = qr/$t_regex/; ## make regex string from
|
$t_regex = qr/$t_regex/; ## make regex string from
|
||||||
## user regex
|
## user regex
|
||||||
@ -820,6 +817,13 @@ sub get_list_of_tables {
|
|||||||
});
|
});
|
||||||
|
|
||||||
my @dbh_tables = eval { $dbh->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();
|
$dbh->disconnect();
|
||||||
return @dbh_tables;
|
return @dbh_tables;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user