]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/commitdiff
partial fix for #69624
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 22 Mar 2012 17:03:16 +0000 (11:03 -0600)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 22 Mar 2012 17:03:16 +0000 (11:03 -0600)
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

index 94b1c07dde938807d001607ae6dfecd1e2e0c091..f8b567de3a2f6c701f5999a7ec1c87f08e301df8 100644 (file)
@@ -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}
This page took 0.020272 seconds and 4 git commands to generate.