]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1152862: Require PostgreSQL 9.0
authorFrédéric Buclin <LpSolit@gmail.com>
Fri, 10 Apr 2015 11:29:22 +0000 (13:29 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Fri, 10 Apr 2015 11:29:22 +0000 (13:29 +0200)
r/a=glob

Bugzilla/Constants.pm
Bugzilla/DB/Pg.pm

index 323fb151cbc93ce37689b3600e03da82f82cfac7..ec2b03c05ec43dd363ab3a59ed0168720084074c 100644 (file)
@@ -527,15 +527,12 @@ use constant DB_MODULE => {
                     version => '4.001',
                 },
                 name => 'MySQL'},
-    # Also see Bugzilla::DB::Pg::bz_check_server_version, which has special
-    # code to require DBD::Pg 2.17.2 for PostgreSQL 9 and above.
-    'pg'    => {db => 'Bugzilla::DB::Pg', db_version => '8.03.0000',
+    'pg'    => {db => 'Bugzilla::DB::Pg', db_version => '9.00.0000',
                 dbd => {
                     package => 'DBD-Pg',
                     module  => 'DBD::Pg',
-                    # 2.7.0 fixes a problem with quoting strings
-                    # containing backslashes in them.
-                    version => '2.7.0',
+                    # Pg 9.2 requires 2.19.3 as spclocation no longer exists.
+                    version => '2.19.3',
                 },
                 name => 'PostgreSQL'},
      'oracle'=> {db => 'Bugzilla::DB::Oracle', db_version => '10.02.0',
index 2ef0c4f5a09257f5b9faf5843b8f0d9eda0faacc..72e4b5b7d850a32b82722508e2db2bdc95574375 100644 (file)
@@ -102,11 +102,6 @@ sub sql_group_concat {
         $order_by = " ORDER BY $1";
     }
 
-    if (vers_cmp($self->bz_server_version, 9) < 0) {
-        # PostgreSQL 8.x doesn't support STRING_AGG
-        return "ARRAY_TO_STRING(ARRAY_AGG($text$order_by), $separator)";
-    }
-
     return "STRING_AGG(${text}::text, $separator${order_by}::text)"
 }
 
@@ -212,20 +207,6 @@ 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, $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} = ($minor_version >= 2) ? '2.19.3' : '2.17.2';
-        local $db->{name} = $db->{name} . " ${major_version}.$minor_version";
-        Bugzilla::DB::_bz_check_dbd(@_);
-    }
-}
-
 sub bz_setup_database {
     my $self = shift;
     $self->SUPER::bz_setup_database(@_);
@@ -436,8 +417,6 @@ sub bz_table_list_real {
 
 =item sql_to_days
 
-=item bz_check_server_version
-
 =item sql_from_days
 
 =item bz_table_list_real