[Dbix-class] clear prefetch in resultset.

brett gardner brett at clientcomm.com.au
Fri Jul 6 00:26:08 GMT 2007


Any pointers / examples on how to write a test file?

So you are saying that you cannot undo the prefetch?

If I do the following

---------------------
my $rs = $app->get_rs_with_prefetch();

$rs = $rs->search(undef,{prefetch=>undef});

my $item = $rs->next;
---------------------

Calling $rs->next still includes the prefetch columns.


Matt S Trout wrote:
> On Thu, Jul 05, 2007 at 12:49:38PM +1000, brett gardner wrote:
>   
>> Is there anyway to set prefetch to empty on a resultset that is created 
>> elsewhere?
>>
>> I have a method in my app that returns a resultset and 99% of the time I 
>> want a particular relationship to be prefetched. But in one particular 
>> instance I do not.
>>
>> I am trying to call $rs->get_column('timestamp_entered')->min. But the 
>> query is barfing because it adds the prefetched relationship fields to 
>> the query.
>>     
>
> That's a bug in the way get_column is implemented, then. If you could put
> together a test file for us, I can get it fixed for the next point release.
>
>   



More information about the Dbix-class mailing list