From: Frédéric Buclin Date: Tue, 16 Oct 2012 09:09:30 +0000 (+0200) Subject: Bug 799721: PostgreSQL 9.2 requires DBD::Pg 2.19.3 X-Git-Tag: bugzilla-4.4rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91249c7ff2216e30fed9ee051d306b7df471a88e;p=thirdparty%2Fbugzilla.git Bug 799721: PostgreSQL 9.2 requires DBD::Pg 2.19.3 r=glob a=LpSolit --- diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index c794bdcc52..cd5fed581d 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -195,11 +195,12 @@ sub bz_check_server_version { my $self = shift; my ($db) = @_; my $server_version = $self->SUPER::bz_check_server_version(@_); - my ($major_version) = $server_version =~ /^(\d+)/; - # Pg 9 requires DBD::Pg 2.17.2 in order to properly read bytea values. + my ($major_version, $minor_version) = $server_version =~ /^0*(\d+)\.0*(\d+)/; + # Pg 9.0 requires DBD::Pg 2.17.2 in order to properly read bytea values. + # Pg 9.2 requires DBD::Pg 2.19.3 as spclocation no longer exists. if ($major_version >= 9) { - local $db->{dbd}->{version} = '2.17.2'; - local $db->{name} = $db->{name} . ' 9+'; + local $db->{dbd}->{version} = ($minor_version >= 2) ? '2.19.3' : '2.17.2'; + local $db->{name} = $db->{name} . " ${major_version}.$minor_version"; Bugzilla::DB::_bz_check_dbd(@_); } }