On Sun, Nov 16, 2008 at 11:51 AM, Zbigniew Lukasiak <[EMAIL PROTECTED]> wrote: > On Sat, Nov 15, 2008 at 9:12 PM, Matt S Trout <[EMAIL PROTECTED]> wrote: >> On Fri, Nov 07, 2008 at 09:51:45AM +0100, Zbigniew Lukasiak wrote: >>> I know this is again not very usual setup - but I provide this info - >>> so that you can make an informed decision about how much >>> back-compatibillity you are going to support for the next version of >>> DBIC. In the past insert worked only on the record passed to it - >>> now it recurses to related records. This fixes some multi-create >>> scenarios - but might be sometimes unexpected. >> >> I see. A suitable failing test patch would be appreciated; we should >> easily be able to modify multi-create to only cascade insert for things >> passed to new() > > In the attached no_recursive_insert.diff you'll find the failing test. > For it to pass in the current CPAN release you need to uncomment the > line marked with "For exact backward compatibility" - in the svn > version this additional line would do nothing ( and this is OK IMHO). > > I am also attaching a tentative patch to insert in DBIx::Class::Row > and create in DBIx::Class::ResultSet in no_recursive_insert_Row.diff. > It is just a proposal.
One addition for those too lazy to run the test: [EMAIL PROTECTED]:~/progs/DBIC$ prove -Ilib t/66relationship.t t/66relationship......1/72 # Failed test 'Reversed staged insertion successful' # at t/66relationship.t line 273. # got: 'DBIx::Class::Row::insert(): DBI Exception: DBD::SQLite::st execute failed: cd.title may not be NULL(19) at dbdimp.c line 403 [for Statement "INSERT INTO cd (artist, cdid, genreid, title, year) VALUES (?, ?, ?, ?, ?)"] at t/66relationship.t line 267 # ' # expected: '' # Failed test 'related artist inserted' # at t/66relationship.t line 274. # Failed test 'cd inserted' # at t/66relationship.t line 275. # Looks like you failed 3 tests of 72. t/66relationship...... Dubious, test returned 3 (wstat 768, 0x300) Failed 3/72 subtests -- Zbigniew Lukasiak http://brudnopis.blogspot.com/ http://perlalchemy.blogspot.com/ _______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/[email protected]
