[Bast-commits] r9055 - in
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage: . DBI
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Thu Mar 25 06:37:36 GMT 2010
Author: caelum
Date: 2010-03-25 06:37:36 +0000 (Thu, 25 Mar 2010)
New Revision: 9055
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm
Log:
add storage->_server_info->{dbms_ver_normalized}
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm 2010-03-25 05:32:51 UTC (rev 9054)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI/Pg.pm 2010-03-25 06:37:36 UTC (rev 9055)
@@ -19,10 +19,8 @@
sub can_insert_returning {
my $self = shift;
- my ($major, $minor) = $self->_server_info->{dbms_ver} =~ /^(\d+)\.(\d+)/;
-
return 1
- if ($major > 8) || ($major == 8 && $minor >= 2);
+ if $self->_server_info->{dbms_ver_normalized} >= 8.002;
return 0;
}
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-03-25 05:32:51 UTC (rev 9054)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-03-25 06:37:36 UTC (rev 9055)
@@ -940,8 +940,13 @@
my $dbms_ver = eval { local $@; $self->_get_dbh->get_info(18) };
- $info{dbms_ver} = $dbms_ver if defined $dbms_ver;
+ if (defined $dbms_ver) {
+ $info{dbms_ver} = $dbms_ver;
+ my @verparts = split /\./, $dbms_ver;
+ $info{dbms_ver_normalized} = sprintf "%d.%03d%03d", @verparts;
+ }
+
$self->__server_info(\%info);
return \%info;
More information about the Bast-commits
mailing list