From 406a1e98b6ea18467b9302993f6b88367cdfaf8d Mon Sep 17 00:00:00 2001 From: Vladimir Melnik Date: Wed, 15 Nov 2017 20:44:03 +0200 Subject: [PATCH] Stop trying to get last_insert_id() from all the columns --- lib/DBIx/Class/Storage/DBI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 16d68e52c..47bbf9fe3 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -2122,7 +2122,7 @@ sub insert { } else { # pull in PK if needed and then everything else - if (my @missing_pri = grep { $pcols{$_} } keys %retrieve_cols) { + if (my @missing_pri = grep { $pcols{$_} && ($col_infos->{$_}->{'is_auto_increment'} || $col_infos->{$_}->{'retrieve_on_insert' }) } keys %retrieve_cols) { $self->throw_exception( "Missing primary key but Storage doesn't support last_insert_id" ) unless $self->can('last_insert_id');