Commit bce2f6bb authored by msvensson@pilot.(none)'s avatar msvensson@pilot.(none)

Merge bk-internal:/home/bk/mysql-5.1-maint

into  pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint
parents 3df9790e 94107592
...@@ -821,30 +821,14 @@ sub get_raid_dirs { ...@@ -821,30 +821,14 @@ sub get_raid_dirs {
sub get_list_of_tables { sub get_list_of_tables {
my ( $db ) = @_; my ( $db ) = @_;
# "use database" cannot cope with database names containing spaces my $tables =
# so create a new connection eval {
$dbh->selectall_arrayref('SHOW TABLES FROM ' .
my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy", $dbh->quote_identifier($db))
$opt{user}, $opt{password}, } || [];
{ warn "Unable to retrieve list of tables in $db: $@" if $@;
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
});
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/;
s/$quote$quote/$quote/g;
}
}
$dbh->disconnect(); return (map { $_->[0] } @$tables);
return @dbh_tables;
} }
sub quote_names { sub quote_names {
......
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