From: Brandon L. Black Date: Thu, 29 Jun 2006 20:20:45 +0000 (+0000) Subject: improvement to mysql version checking X-Git-Tag: v0.07002~75^2~70 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f750163c3972a376e3ea86d52e2091e8cc66809a;p=dbsrgits%2FDBIx-Class.git improvement to mysql version checking --- diff --git a/t/71mysql.t b/t/71mysql.t index 5fb027e..aeb73ea 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -69,10 +69,13 @@ my $test_type_info = { SKIP: { my $mysql_version = $dbh->get_info( $GetInfoType{SQL_DBMS_VER} ); - skip "Cannot determine MySQL server version", 1 if !$mysql_version; - my ($v1, $v2, $v3) = split(/\./, $mysql_version); + my ($v1, $v2, $v3) = $mysql_version =~ /^(\d+)\.(\d+)(?:\.(\d+))?/; + skip "Cannot determine MySQL server version", 1 if !$v1 || !defined($v2); + + $v3 ||= 0; + if( ($v1 < 5) || ($v1 == 5 && $v2 == 0 && $v3 <= 3) ) { $test_type_info->{charfield}->{data_type} = 'VARCHAR'; }