X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F746mssql.t;h=802e469abd720b9eaa438bea583747b1198ef331;hb=118c7b0c9c25d6c189f35903a5846510ed26bb13;hp=52b535772316597fcbda0a31be66c81436e1f4a7;hpb=c1cac6332247a092ddc886c52607b24104c3fb46;p=dbsrgits%2FDBIx-Class.git diff --git a/t/746mssql.t b/t/746mssql.t index 52b5357..802e469 100644 --- a/t/746mssql.t +++ b/t/746mssql.t @@ -17,11 +17,11 @@ my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {AutoCommit => 1}); $schema->storage->ensure_connected; isa_ok( $schema->storage, 'DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server' ); -my $dbh = $schema->storage->dbh; +$schema->storage->dbh_do (sub { + my ($storage, $dbh) = @_; + eval { $dbh->do("DROP TABLE artist") }; + $dbh->do(<<'SQL'); -eval { $dbh->do("DROP TABLE artist") }; - - $dbh->do(<<''); CREATE TABLE artist ( artistid INT IDENTITY NOT NULL, name VARCHAR(255), @@ -29,6 +29,10 @@ CREATE TABLE artist ( primary key(artistid) ) +SQL + +}); + my %seen_id; # test primary key handling @@ -58,6 +62,7 @@ is( $it->next, undef, "next past end of resultset ok" ); # clean up our mess END { + my $dbh = eval { $schema->storage->_dbh }; $dbh->do('DROP TABLE artist') if $dbh; }