cvsserver: Use DBI->table_info instead of DBI->tables
authorFrank Lichtenheld <frank@lichtenheld.de>
Sat, 31 Mar 2007 13:57:47 +0000 (15:57 +0200)
committerJunio C Hamano <junkio@cox.net>
Sat, 31 Mar 2007 23:09:49 +0000 (16:09 -0700)
DBI->table_info is portable across different DBD backends,
DBI->tables is not.

Limit the output to objects of type TABLE.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
git-cvsserver.perl

index 941a91bcac6bb54cbbe092f54c16753f49948e5a..5532ae7a31a4cececeffc8bd686d96b71d6b85a9 100755 (executable)
@@ -2171,10 +2171,8 @@ sub new
     die "Error connecting to database\n" unless defined $self->{dbh};
 
     $self->{tables} = {};
-    foreach my $table ( $self->{dbh}->tables )
+    foreach my $table ( keys %{$self->{dbh}->table_info(undef,undef,undef,'TABLE')->fetchall_hashref('TABLE_NAME')} )
     {
-        $table =~ s/^"//;
-        $table =~ s/"$//;
         $self->{tables}{$table} = 1;
     }