From: Rob Kinyon Date: Fri, 6 Mar 2009 14:57:38 +0000 (+0000) Subject: Added solution, though no fix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4f107c65cb17cc9062e23b979dece62516701e96;p=dbsrgits%2FDBIx-Class-Historic.git Added solution, though no fix --- diff --git a/t/98rows_prefetch.t b/t/98rows_prefetch.t index d7ec720..1b19f3e 100644 --- a/t/98rows_prefetch.t +++ b/t/98rows_prefetch.t @@ -41,26 +41,6 @@ TODO: { . " \$use_prefetch_count == $use_prefetch_count)" ); } -__END__ -my $rs1 = $schema->resultset('Artist')->search( - undef, { -# join => 'cds', - }, -); -warn ${$rs1->as_query}->[0], $/; -{ my @x = $rs1->all; warn "$#x\n"; } - -my $rs2 = $schema->resultset('Artist')->search( - undef, { - from => [{ - me => $rs1->as_query, - }], - prefetch => 'cds', - }, -); - -warn ${$rs2->as_query}->[0], $/; -{ my @x = $rs2->all; warn "$#x\n"; } __END__ The fix is to, when using prefetch, take the query and put it into a subquery @@ -99,6 +79,3 @@ becomes: Problem: * The prefetch->join change needs to happen ONLY IF there are conditions that depend on bar being joined. - * How will this work when the $rs is further searched on? Those clauses - need to be added to the subquery, not the outer one. This is particularly - true if rows is added in the attribute later per the Pager.