From a4ae80a43078cb33f759863c6f436619290137c3 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 14 Feb 2011 12:00:17 -0800 Subject: Bug 603127: Make checksetup.pl require DBD::Pg 2.17.2 when using Pg 9.0 or later. r=dkl, a=mkanat --- Bugzilla/DB/Pg.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Bugzilla/DB/Pg.pm') diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index 7802d58ef..e59a638a4 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -211,6 +211,19 @@ sub bz_explain { # Custom Database Setup ##################################################################### +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. + if ($major_version >= 9) { + local $db->{dbd}->{version} = '2.17.2'; + local $db->{name} = $db->{name} . ' 9+'; + Bugzilla::DB::_bz_check_dbd(@_); + } +} + sub bz_setup_database { my $self = shift; $self->SUPER::bz_setup_database(@_); -- cgit v1.2.3-24-g4f1b