X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=e33b77f72cb97371952c156751c274e74b281042;hb=1a58752c42ba9acf33e2943b678de4948cf3ee3f;hp=b75ac8742dcc946efb4c3ca36fc53bc0db693631;hpb=758b5941171ad244192af1d5553d76a780394c72;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index b75ac87..e33b77f 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -1002,6 +1002,8 @@ sub _connect { $weak_self->throw_exception("DBI Exception: $_[0]"); } else { + # the handler may be invoked by something totally out of + # the scope of DBIC croak ("DBI Exception: $_[0]"); } }; @@ -1339,12 +1341,7 @@ sub insert_bulk { my %colvalues; my $table = $source->from; @colvalues{@$cols} = (0..$#$cols); - - my ($sql, $bind) = $self->_prep_for_execute ( - 'insert', undef, $source, [\%colvalues] - ); - my @bind = @$bind - or croak 'Cannot insert_bulk without support for placeholders'; + my ($sql, @bind) = $self->sql_maker->insert($table, \%colvalues); $self->_query_start( $sql, @bind ); my $sth = $self->sth($sql); @@ -1376,7 +1373,6 @@ sub insert_bulk { $placeholder_index++; } my $rv = eval { $sth->execute_array({ArrayTupleStatus => $tuple_status}) }; - $sth->finish; if (my $err = $@) { my $i = 0; ++$i while $i <= $#$tuple_status && !ref $tuple_status->[$i];