[PATCH] cvsserver: Use DBI->table_info instead of DBI->tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



DBI->table_info is portable across different DBD backends,
DBI->tables is not.

Limit the output to objects of type TABLE.
---
 git-cvsserver.perl |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

 Obviously to be applied on top of my previous
 patch series.
 
 With this patch I was able to use DBD::Pg as backend.
 It is not very comfortable because of the "one db for
 each module" problem, but at least it works.

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 941a91b..5532ae7 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -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;
     }
 
-- 
1.5.0.3

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]