Nevermind, I stupidly forgot to assign the modified resultset :-) I'll pull the RT bug too.....
On Fri, Nov 26, 2010 at 4:24 PM, Ryan Tate <[email protected]> wrote: > It appears if you specify prefetch twice on the same resultset, only > the first one sticks. E.g.: > > my $rs = $schema->resultset('Artist')->search( {}, > {prefetch => ['cds'],} > ); > $rs->search({}, > {prefetch => ['stalkers'],} > ); > > According to the docs, prefetches are supposed to be merged in this > scenario <http://search.cpan.org/~frew/DBIx-Class- > 0.08124/lib/DBIx/Class/ResultSet.pm#Resolving_conditions_and_attributes> > > If you monitor the SQL that gets executed, the first prefetch ("cds") > sticks but the second prefetch ("stalkers") doesn't get executed, and > DBIx::Class will go to the database every time you call it on the > fetched items ($artist->stalkers->first). > > There's a failing test case here > http://ryantate.com/transfer/dbixc_prefetch.t.txt > > And I added an RT entry here > https://rt.cpan.org/Public/Bug/Display.html?id=63360 > _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
