From: Rafael Kitover Date: Sat, 29 Aug 2009 22:02:20 +0000 (+0000) Subject: test correlated subquery X-Git-Tag: v0.08112~14^2~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7357c7bc904dffcc917657c98e4bdef93d253117;p=dbsrgits%2FDBIx-Class.git test correlated subquery --- diff --git a/t/746sybase.t b/t/746sybase.t index 5c05fba..7a71bd0 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -11,7 +11,7 @@ use DBIx::Class::Storage::DBI::Sybase::NoBindVars; 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 => @@ -188,6 +188,15 @@ SQL } } +# 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