my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/};
-my $TESTS = 38 + 2;
+my $TESTS = 39 + 2;
if (not ($dsn && $user)) {
plan skip_all =>
"\nWarning: This test drops and creates the tables " .
"'artist' and 'bindtype_test'";
} else {
- plan tests => $TESTS*2;
+ plan tests => $TESTS*2 + 1;
}
my @storage_types = (
}
}
+# test correlated subquery
+ my $subq = $schema->resultset('Artist')->search({ artistid => { '>' => 3 } })
+ ->get_column('artistid')
+ ->as_query;
+ my $subq_rs = $schema->resultset('Artist')->search({
+ artistid => { -in => $subq }
+ });
+ is $subq_rs->count, 11, 'correlated subquery';
+
# mostly stolen from the blob stuff Nniuq wrote for t/73oracle.t
SKIP: {
skip 'TEXT/IMAGE support does not work with FreeTDS', 12
if $schema->storage->using_freetds;
- my $dbh = $schema->storage->dbh;
+ my $dbh = $schema->storage->_dbh;
{
local $SIG{__WARN__} = sub {};
eval { $dbh->do('DROP TABLE bindtype_test') };
SQL
});
-# First, we'll open a cursor to test insert transactions when there's an active
-# cursor.
- SKIP: {
- skip 'not testing insert with active cursor unless using insert_txn', 1
- unless $schema->storage->insert_txn;
-
- my $artist_rs = $schema->resultset('Artist');
- $artist_rs->first;
- lives_ok {
- my $row = $schema->resultset('Money')->create({ amount => 100 });
- $row->delete;
- } 'inserted a row with an active cursor';
+# test insert transactions when there's an active cursor
+ TODO: {
+ local $TODO = 'not supported yet or possibly ever';
+
+ SKIP: {
+ skip 'not testing insert with active cursor if using unsafe_insert', 1
+ if $schema->storage->unsafe_insert;
+
+ my $artist_rs = $schema->resultset('Artist');
+ $artist_rs->first;
+ lives_ok {
+ my $row = $schema->resultset('Money')->create({ amount => 100 });
+ $row->delete;
+ } 'inserted a row with an active cursor';
+ $ping_count-- if $@; # dbh_do calls ->connected
+ }
}
# Now test money values.
diag $@ if $@;
}
+is $ping_count, 0, 'no pings';
+
# clean up our mess
END {
if (my $dbh = eval { $schema->storage->_dbh }) {
eval { $dbh->do("DROP TABLE $_") }
for qw/artist bindtype_test money_test/;
}
- diag "ping count was $ping_count" unless $ping_count == 0;
}