X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746mssql.t;h=4cd1c6ad224e2a2a1c3194f2a009312afe5a23a6;hb=1f4263ebe497f0a4a7dbde8850a8d1736946740d;hp=f9cbf85589b9b19f611d81c8d449802b0aad6fe6;hpb=ca791b95e618ab76bddbaf58441e3d6873336850;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746mssql.t b/t/746mssql.t index f9cbf85..4cd1c6a 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -54,13 +54,24 @@ my $new; # test Auto-PK with different options for my $opts (@opts) { - $schema = DBICTest::Schema->clone; - $schema->connection($dsn, $user, $pass, $opts); + SKIP: { + $schema = DBICTest::Schema->connect($dsn, $user, $pass, $opts); - $schema->resultset('Artist')->search({ name => 'foo' })->delete; + eval { + $schema->storage->ensure_connected + }; + if ($@ =~ /dynamic cursors/) { + skip +'Dynamic Cursors not functional, tds_version 8.0 or greater required if using'. +' FreeTDS', 1; + } - $new = $schema->resultset('Artist')->create({ name => 'foo' }); - ok($new->artistid > 0, "Auto-PK worked"); + $schema->resultset('Artist')->search({ name => 'foo' })->delete; + + $new = $schema->resultset('Artist')->create({ name => 'foo' }); + + ok($new->artistid > 0, "Auto-PK worked"); + } } $seen_id{$new->artistid}++; @@ -100,6 +111,9 @@ CREATE TABLE artist ( SQL }); +# start disconnected to make sure insert works on an un-reblessed storage +$schema = DBICTest::Schema->connect($dsn, $user, $pass); + my $row; lives_ok { $row = $schema->resultset('ArtistGUID')->create({ name => 'mtfnpy' }) @@ -131,14 +145,11 @@ $schema->storage->dbh_do (sub { my ($storage, $dbh) = @_; eval { $dbh->do("DROP TABLE money_test") }; $dbh->do(<<'SQL'); - CREATE TABLE money_test ( id INT IDENTITY PRIMARY KEY, amount MONEY NULL ) - SQL - }); my $rs = $schema->resultset('Money');