1 # Test to ensure we get a consistent result set wether or not we use the
2 # prefetch option in combination rows (LIMIT).
10 plan skip_all => 'fix pending';
13 my $schema = DBICTest->init_schema();
14 my $no_prefetch = $schema->resultset('Artist')->search(
19 my $use_prefetch = $schema->resultset('Artist')->search(
27 is($no_prefetch->count, $use_prefetch->count, '$no_prefetch->count == $use_prefetch->count');
29 scalar ($no_prefetch->all),
30 scalar ($use_prefetch->all),
31 "Amount of returned rows is right"
36 my $artist_many_cds = $schema->resultset('Artist')->search ( {}, {
38 group_by => 'me.artistid',
39 having => \ 'count(cds.cdid) > 1',
43 $no_prefetch = $schema->resultset('Artist')->search(
44 { artistid => $artist_many_cds->id },
48 $use_prefetch = $schema->resultset('Artist')->search(
49 { artistid => $artist_many_cds->id },
56 my $prefetch_artist = $use_prefetch->first;
57 my $normal_artist = $no_prefetch->first;
60 $prefetch_artist->cds->count,
61 $normal_artist->cds->count,
62 "Count of child rel with prefetch + rows => 1 is right"
65 scalar ($prefetch_artist->cds->all),
66 scalar ($normal_artist->cds->all),
67 "Amount of child rel rows with prefetch + rows => 1 is right"