Some time ago, I've reported a pretty nasty bug I encountered when prefetching nested has_many relationships. At the time I tried fixing it myself but the best I could do was finding where the bug seemed to happen in the code but I couldn't really fix it.
The bug consists in DBIC ignoring rows that are present in the result from the database (i.e. the query is correctly generated) and messing everything up when you've got a situation like A has_many B has_many C and some Bs don't have Cs while other Bs have multiple Cs. So, mst requested some test cases that'd reproduce the bug. I've finally wrote the test case which reproduces the said bug and it's attached. The bug is present as of DBIC 0.07003. I couldn't really integrate it into the already existing testing infrastructure since I was kinda lost regarding where to put things. So I hope someone who knows better can do it. test.sql creates the database structures (don't know if it's portable, written for MySQL) and test.pl demonstrates the bug. The Schema classes were autogenerated. Hopefully this test case will be enough. -Nilson Santos F. Jr.
dbicbug.tar.gz
Description: GNU Zip compressed data
_______________________________________________ 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]/
