From 982b1ba172104d6cd67807e78dddbe71b3074394 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Thu, 22 Mar 2012 11:03:16 -0600 Subject: [PATCH] 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. --- lib/DBIx/Class/ResultSet/RecursiveUpdate.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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} -- 2.45.2