Institute a central "load this first in testing" package
[dbsrgits/DBIx-Class.git] / t / count / in_subquery.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
ff1393c7 3use strict;
4use warnings;
5
ff1393c7 6use Test::More;
7
c0329273 8
ff1393c7 9use DBICTest;
ff1393c7 10
11my $schema = DBICTest->init_schema();
12
13{
14 my $rs = $schema->resultset("CD")->search(
15 { 'artist.name' => 'Caterwauler McCrae' },
16 { join => [qw/artist/]}
17 );
18 my $squery = $rs->get_column('cdid')->as_query;
19 my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $squery } } );
20 is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
21}
f54428ab 22
23done_testing;