From: Rafael Kitover Date: Fri, 5 Feb 2010 10:07:14 +0000 (+0000) Subject: support autoinc PKs without is_auto_increment set X-Git-Tag: v0.08121~73^2~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e8d182b723a69a1ced6ca91b27b02d8a860379f;p=dbsrgits%2FDBIx-Class.git support autoinc PKs without is_auto_increment set --- diff --git a/lib/DBIx/Class/Storage/DBI/InterBase.pm b/lib/DBIx/Class/Storage/DBI/InterBase.pm index 3abb504..0d92cb3 100644 --- a/lib/DBIx/Class/Storage/DBI/InterBase.pm +++ b/lib/DBIx/Class/Storage/DBI/InterBase.pm @@ -19,10 +19,16 @@ sub _prep_for_execute { my ($sql, $bind) = $self->next::method (@_); if ($op eq 'insert') { + my @pk = $ident->primary_columns; + my %pk; + @pk{@pk} = (); + my @auto_inc_cols = grep { my $inserting = $args->[0]{$_}; - $ident->column_info($_)->{is_auto_increment} && ( + ($ident->column_info($_)->{is_auto_increment} + || exists $pk{$_}) + && ( (not defined $inserting) || (ref $inserting eq 'SCALAR' && $$inserting =~ /^null\z/i)