From: Peter Rabbitson Date: Tue, 12 Apr 2016 14:25:58 +0000 (+0200) Subject: Fix forgotten finally{} in Sybase::ASE (missed in ddcc02d14) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=f967004237e287bab2d2b05401dcff06d89ad4b8 Fix forgotten finally{} in Sybase::ASE (missed in ddcc02d14) I guess my grep-fu failed me, the finally is right there... As per the comment nothing seems to fail if I just remove this, but ASE is so fragile that I'll just play it safe... --- diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index 204ce12..a6ff2c7 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -14,7 +14,7 @@ use Scalar::Util qw/blessed weaken/; use Sub::Name(); use Try::Tiny; use Context::Preserve 'preserve_context'; -use DBIx::Class::_Util qw( sigwarn_silencer dbic_internal_try dump_value ); +use DBIx::Class::_Util qw( sigwarn_silencer dbic_internal_try dump_value scope_guard ); use namespace::clean; __PACKAGE__->sql_limit_dialect ('GenericSubQ'); @@ -780,6 +780,12 @@ sub _insert_blobs { ); } + # FIXME - it is not clear if this is needed at all. But it's been + # there since 2009 ( d867eedaa ), might as well let sleeping dogs + # lie... sigh. + weaken( my $wsth = $sth ); + my $g = scope_guard { $wsth->finish if $wsth }; + dbic_internal_try { do { $sth->func('CS_GET', 1, 'ct_data_info') or die $sth->errstr; @@ -808,9 +814,6 @@ sub _insert_blobs { else { $self->throw_exception($_); } - } - finally { - $sth->finish if $sth; }; } }