From: Charles McGarvey Date: Thu, 22 Mar 2012 17:03:16 +0000 (-0600) Subject: partial fix for #69624 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=982b1ba172104d6cd67807e78dddbe71b3074394;p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate partial fix for #69624 This uncomments a call to _delete_empty_auto_increment. True to its name, this function removes NULL auto-increments from the column info so that they are not INSERTed. The call to this method was commented out in 93ad3243, but I cannot find anyone who remembers why, and re-enabling the call does not break any other tests on postgres, mysql, or sqlite. However, this change alone does not cause the test to pass; there are still issues with databases which enforce foreign constraints (tested on postgres, mysql, and sqlite with the foreign_keys pragma). I'm not sure if the test itself is broken, but maybe it should at least be marked as TODO. --- diff --git a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm index 94b1c07..f8b567d 100644 --- a/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm +++ b/lib/DBIx/Class/ResultSet/RecursiveUpdate.pm @@ -207,7 +207,7 @@ sub recursive_update { $if_not_submitted ); } - # $self->_delete_empty_auto_increment($object); + _delete_empty_auto_increment($object); # don't allow insert to recurse to related objects # do the recursion ourselves # $object->{_rel_in_storage} = 1; @@ -490,7 +490,7 @@ sub get_m2m_source { } sub _delete_empty_auto_increment { - my ( $self, $object ) = @_; + my ( $object ) = @_; for my $col ( keys %{ $object->{_column_data} } ) { if ($object->result_source->column_info($col)->{is_auto_increment} and ( !defined $object->{_column_data}{$col}