[Dbix-class] inner join in prefetch drops some rows
Ronald J Kimball
rkimball+dbixclass at pangeamedia.com
Mon Jun 4 15:08:12 GMT 2007
Paul Makepeace wrote:
> I have a feeling this issue is known about from a message back on the
> 11th about collapse result but just in case:
>
> I notice adding a prefetch to a search causes some results to go
> missing in the case that the column being joined on is null in the
> first table. This is down to prefetch using an inner rather than left
> join. Presumably y'all had a reason for that? The left join solved it
> for me (in SQL tests). Is there a work-around for this?
You haven't shown us how you're defining your relationships, nor your
code to do the search.
If I define a might_have() relationship and do a prefetch, I get a LEFT
JOIN, as I expected. Perhaps you specified a has_one() relationship
where you meant to specify might_have()?
Ronald
More information about the Dbix-class
mailing list