X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F71mysql.t;h=3bbdaa1a113e188767fa1700854266b4b6be3d89;hb=94eb74cb97fc7d2596dfb964849b01c5ecd18ea3;hp=93f45fddb6da8922fe2e1a5611827dda0a34929f;hpb=d6915f449e2d68ac184d6bc616043fd605913757;p=dbsrgits%2FDBIx-Class.git diff --git a/t/71mysql.t b/t/71mysql.t index 93f45fd..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; @@ -59,19 +60,29 @@ my $test_type_info = { 'default_value' => undef, }, 'charfield' => { - 'data_type' => 'VARCHAR', + 'data_type' => 'CHAR', 'is_nullable' => 1, 'size' => 10, 'default_value' => undef, }, }; +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) = $mysql_version =~ /^(\d+)\.(\d+)(?:\.(\d+))?/; + skip "Cannot determine MySQL server version", 1 if !$v1 || !defined($v2); -my $type_info = MySQLTest->schema->storage->columns_info_for('artist'); -is_deeply($type_info, $test_type_info, 'columns_info_for - column data types'); + $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"); -