[Bast-commits] r9105 - DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Thu Apr 8 10:56:33 GMT 2010
Author: ribasushi
Date: 2010-04-08 11:56:33 +0100 (Thu, 08 Apr 2010)
New Revision: 9105
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
Log:
Even safer version normalization
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-04-08 10:36:05 UTC (rev 9104)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/Storage/DBI.pm 2010-04-08 10:56:33 UTC (rev 9105)
@@ -950,11 +950,18 @@
if (
@verparts
&&
- @verparts <= 3
- &&
- ! grep { $_ > 999 } (@verparts)
+ $verparts[0] <= 999
) {
- $info{normalized_dbms_version} = sprintf "%d.%03d%03d", @verparts;
+ # consider only up to 3 version parts, iff not more than 3 digits
+ my @use_parts;
+ while (@verparts && @use_parts < 3) {
+ my $p = shift @verparts;
+ last if $p > 999;
+ push @use_parts, $p;
+ }
+ push @use_parts, 0 while @use_parts < 3;
+
+ $info{normalized_dbms_version} = sprintf "%d.%03d%03d", @use_parts;
}
}
More information about the Bast-commits
mailing list