}
}
-my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PASS/};
+my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PASS/};
my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_MSSQL_${_}" } qw/DSN USER PASS/};
+my ($dsn3, $user3, $pass3) = @ENV{map { "DBICTEST_MSSQL_ADO_${_}" } qw/DSN USER PASS/};
-if (not ($dsn || $dsn2)) {
+if (not ($dsn || $dsn2 || $dsn3)) {
plan skip_all =>
- 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN} and/or $ENV{DBICTEST_MSSQL_DSN} _USER '
- .'and _PASS to run this test' .
- "\nWarning: This test drops and creates a table called 'small_dt'";
+ 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN} and/or $ENV{DBICTEST_MSSQL_DSN} and/or '
+ .'$ENV{DBICTEST_MSSQL_ADO_DSN} _USER and _PASS to run this test' .
+ "\nWarning: This test drops and creates tables called 'event_small_dt' and"
+ ." 'track'.";
}
plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt')
my @connect_info = (
[ $dsn, $user, $pass ],
[ $dsn2, $user2, $pass2 ],
+ [ $dsn3, $user3, $pass3 ],
);
my $schema;
my $guard = Scope::Guard->new(\&cleanup);
- try { $schema->storage->dbh->do("DROP TABLE track") };
+ # $^W because DBD::ADO is a piece of crap
+ try { local $^W = 0; $schema->storage->dbh->do("DROP TABLE track") };
$schema->storage->dbh->do(<<"SQL");
CREATE TABLE track (
trackid INT IDENTITY PRIMARY KEY,
last_updated_at DATETIME,
)
SQL
- try { $schema->storage->dbh->do("DROP TABLE event_small_dt") };
+ try { local $^W = 0; $schema->storage->dbh->do("DROP TABLE event_small_dt") };
$schema->storage->dbh->do(<<"SQL");
CREATE TABLE event_small_dt (
id INT IDENTITY PRIMARY KEY,
for my $dt_type (@dt_types) {
my ($type, $col, $source, $pk, $create_extra, $sample_dt) = @$dt_type;
+ delete $sample_dt->{nanosecond} if $dsn =~ /:ADO:/;
+
ok(my $dt = DateTime->new($sample_dt));
my $row;