From: Rafael Kitover Date: Wed, 3 Feb 2010 16:36:39 +0000 (+0000) Subject: minor code cleanup for SQL Anywhere last_insert_id X-Git-Tag: v0.08116~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b0267fb70f1374d43e4512d8d1006d9f6fd3500b;p=dbsrgits%2FDBIx-Class.git minor code cleanup for SQL Anywhere last_insert_id --- diff --git a/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm b/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm index fe58f77..936edb1 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLAnywhere.pm @@ -39,17 +39,11 @@ sub insert { my $self = shift; my ($source, $to_insert) = @_; - my $supplied_col_info = $self->_resolve_column_info($source, [keys %$to_insert]); - - my $is_identity_insert = (List::Util::first { $_->{is_auto_increment} } (values %$supplied_col_info) ) - ? 1 - : 0; - my $identity_col = List::Util::first { $source->column_info($_)->{is_auto_increment} } $source->columns; - if ((not $is_identity_insert) && $identity_col) { + if ($identity_col && (not exists $to_insert->{$identity_col})) { my $dbh = $self->_get_dbh; my $table_name = $source->from; $table_name = $$table_name if ref $table_name;