use Test::More;
-plan ( tests => 6 );
+plan ( tests => 5 );
use lib qw(t/lib);
use DBICTest;
}
{
- my $rs = $schema->resultset("CD")->search(
- { 'artist.name' => 'Caterwauler McCrae' },
- { join => [qw/artist/]}
- );
- my $query = $rs->get_column('cdid')->as_query({ skip_parens => 1 });
- my ($sql, @bind) = @{$$query};
- is_same_sql_bind(
- $sql, \@bind,
- 'SELECT me.cdid FROM cd me JOIN artist artist ON artist.artistid = me.artist WHERE ( artist.name = ? )',
- [['artist.name' => 'Caterwauler McCrae']]
- );
- my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $query } } );
- is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
+ my $rs = $schema->resultset("CD")->search(
+ { 'artist.name' => 'Caterwauler McCrae' },
+ { join => [qw/artist/]}
+ );
+ my $subsel_rs = $schema->resultset("CD")->search( { cdid => { IN => $rs->get_column('cdid')->as_query } } );
+ is($subsel_rs->count, $rs->count, 'Subselect on PK got the same row count');
}
-
-__END__