Dumper follies
[dbsrgits/DBIx-Class.git] / t / count / in_subquery.t
CommitLineData
ff1393c7 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
ff1393c7 6use Test::More;
7
8plan ( tests => 1 );
9
10use lib qw(t/lib);
11use DBICTest;
12use DBIC::SqlMakerTest;
13
14my $schema = DBICTest->init_schema();
15
16{
17 my $rs = $schema->resultset("CD")->search(
18 { 'artist.name' => 'Caterwauler McCrae' },
19 { join => [qw/artist/]}
20 );
21 my $squery = $rs->get_column('cdid')->as_query;
22 my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $squery } } );
23 is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
24}