diff -Naur DBD-Pg-1.42/Pg.pm new/Pg.pm
--- DBD-Pg-1.42/Pg.pm Sun May 22 00:36:05 2005
+++ new/Pg.pm Mon May 30 21:38:59 2005
@@ -1269,8 +1269,13 @@
}
elsif ($ans eq 'ODBCVERSION') {
my $version = $dbh->{private_dbdpg}{version};
- my $dotted = $version =~ /(\d\d?)\.(\d\d)(\d\d)$/ ? "$1.$2.$4" : "0.0.0";
- return sprintf "%02d.%02d.%1d%1d%1d%1d", split (/\./, "$dotted.0.0.0.0.0.0");
+ if ($version > 80000) {
+ my $dotted = $version =~ /(\d?\d)(\d\d)(\d\d)$/ ? "$1.$2.$3" : "0.0.0";
+ return sprintf "%02d.%02d.%1d%1d%1d%1d", split (/\./, "$dotted.0.0.0.0.0.0");
+ } else {
+ my $dotted = $version =~ /(\d\d?)\.(\d\d)(\d\d)$/ ? "$1.$2.$3" : "0.0.0";
+ return sprintf "%02d.%02d.%1d%1d%1d%1d", split (/\./, "$dotted.0.0.0.0.0.0");
+ }
}
elsif ($ans eq 'DBDVERSION') {
my $simpleversion = $DBD::Pg::VERSION;
diff -Naur DBD-Pg-1.42/t/03dbmethod.t new/t/03dbmethod.t
--- DBD-Pg-1.42/t/03dbmethod.t Tue May 17 08:50:51 2005
+++ new/t/03dbmethod.t Mon May 30 21:47:24 2005
@@ -17,7 +17,7 @@
$|=1;
if (defined $ENV{DBI_DSN}) {
- plan tests => 137;
+ plan tests => 138;
} else {
plan skip_all => 'Cannot run test unless DBI_DSN is defined. See the README file';
}
@@ -265,6 +265,9 @@
my $forth = $dbh->get_info($get_info{$_});
ok( defined $forth, qq{DB handle method "get_info" works with a value of "$get_info{$_}"});
is( $back, $forth, qq{DB handle method "get_info" returned matching values});
+ if ($_ eq 'SQL_DBMS_VERSION') {
+ ok((split /\./, $forth)[0] > 0, "Version number detected\n");
+ }
}
#