Really fix INSERT RETURNING - simply make it a flag on the storage and keep the machi...
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Row.pm
index 07cfe71..ceb38d5 100644 (file)
@@ -363,8 +363,8 @@ sub insert {
   my $updated_cols = $source->storage->insert(
     $source,
     { $self->get_columns },
-    keys %auto_pri
-      ? { returning => [ sort { $auto_pri{$a} <=> $auto_pri{$b} } keys %auto_pri ] }
+    (keys %auto_pri) && $source->storage->can_insert_returning
+      ? { returning => [ sort { $auto_pri{$a} cmp $auto_pri{$b} } keys %auto_pri ] }
       : ()
     ,
   );