diff options
author | unknown <tsmith@ramayana.hindu.god> | 2007-08-28 13:24:31 -0600 |
---|---|---|
committer | unknown <tsmith@ramayana.hindu.god> | 2007-08-28 13:24:31 -0600 |
commit | 4dac538a0b73ebbc2aa65f7bcd7327a4e15e0feb (patch) | |
tree | c3281f82518636b739b569856ca3af58a94e7772 /scripts | |
parent | 484069cf00ea15e3b690228ddf81752704fac390 (diff) | |
parent | 539d58a36aac78f23c670f5b785fe9e4a3d48655 (diff) | |
download | mariadb-git-4dac538a0b73ebbc2aa65f7bcd7327a4e15e0feb.tar.gz |
Merge ramayana.hindu.god:/home/tsmith/m/bk/maint/b27694/50
into ramayana.hindu.god:/home/tsmith/m/bk/maint/50
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqlhotcopy.sh | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 61cd59457d1..6ad5c77b954 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -821,30 +821,14 @@ sub get_raid_dirs { sub get_list_of_tables { my ( $db ) = @_; - # "use database" cannot cope with database names containing spaces - # so create a new connection - - my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy", - $opt{user}, $opt{password}, - { - 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 @dbh_tables; + my $tables = + eval { + $dbh->selectall_arrayref('SHOW TABLES FROM ' . + $dbh->quote_identifier($db)) + } || []; + warn "Unable to retrieve list of tables in $db: $@" if $@; + + return (map { $_->[0] } @$tables); } sub quote_names { |