X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FRow.pm;h=f9784d0747bf80f119a8e9f24536e6a3fe2b9eaf;hb=227d836679dd2e91b1cf49c3d9e566be79f49297;hp=7716985f358f62c0735d37dbc0a7476c2dad9355;hpb=47c397cda78c09d32350a63095e877e9680fb4cf;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 7716985..f9784d0 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -363,8 +363,8 @@ sub insert { my $updated_cols = $source->storage->insert( $source, { $self->get_columns }, - keys %auto_pri - ? { returning => [ sort { $auto_pri{$a} cmp $auto_pri{$b} } keys %auto_pri ] } + (keys %auto_pri) && $source->storage->_supports_insert_returning + ? { returning => [ sort { $auto_pri{$a} <=> $auto_pri{$b} } keys %auto_pri ] } : () , ); @@ -484,7 +484,7 @@ the database row can not be constructed (see L for more details). -Also takes an optional hashref of C<< column_name => value> >> pairs +Also takes an optional hashref of C<< column_name => value >> pairs to update on the object first. Be aware that the hashref will be passed to C, which might edit it in place, so don't rely on it being the same after a call to C. If you