Hi everyone,
I'm experiencing an issue I believe to be a DBIC bug. Or maybe it's
just expected behaviour (which would be quite weird).
I have three tables set up so that A has_many B and B has_many C.
If I issue a search using this syntax:
$A->search( undef,
{ prefetch => { B => ['C'] } }
);
It returns bogus results. The weird thing is that the generated query
returns correct results when I run it manually.
However, if add a order_by clause, like this:
$A->search( undef,
{ prefetch => { B => ['C'] }, order_by => 'me.name' }
);
It suddenly starts working alright.
It seems that DBIC's resultset munging thing is getting confused when
things are not ordered. I could provide further info if necessary, but
those are plain has_many relationships, so I suppose it shouldn't be
very hard to reproduce.
If I end up diving into DBIC code and manage to find out anything that
could explain this behaviour I'll try coming up with patch (if that's
the case).
-Nilson Santos F. Jr.
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/