X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=3bbdaa1a113e188767fa1700854266b4b6be3d89;hb=6c0ddbf737fa59fd988b0ca3bdbd0e68d2ef9e6d;hp=4ae1ef8c493510a84e115a8b6f3b9b36ed9a60ad;hpb=637219abbaf7c4203d256b199afa0f52704bdec6;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/71mysql.t b/t/71mysql.t index 4ae1ef8..3bbdaa1 100644 --- a/t/71mysql.t +++ b/t/71mysql.t @@ -4,6 +4,7 @@ use warnings; use Test::More; use lib qw(t/lib); use DBICTest; +use DBI::Const::GetInfoType; my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/}; @@ -14,7 +15,7 @@ plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test plan tests => 5; -DBICTest::Schema->compose_connection('MySQLTest' => $dsn, $user, $pass); +DBICTest::Schema->compose_namespace('MySQLTest' => $dsn, $user, $pass); my $dbh = MySQLTest->schema->storage->dbh; @@ -66,12 +67,22 @@ 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 $type_info = MySQLTest->schema->storage->columns_info_for('artist'); -is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); + 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'; + } + + my $type_info = MySQLTest->schema->storage->columns_info_for('artist'); + is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); +} # clean up our mess $dbh->do("DROP TABLE artist"); -