From: Peter Rabbitson Date: Tue, 13 Sep 2016 05:03:52 +0000 (+0200) Subject: Remove non-functional part of ::Storage::DBI::Sybase::_ping X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=82c5f9168e30bc9dc7b681058298bb342582c5ec Remove non-functional part of ::Storage::DBI::Sybase::_ping This code has existed in one form or another since about 322b7a6b, and failed multiple levels of review and later was left as-is due to a lack of a testing rig :/ It seems that the simple change is sufficient, but more testing with more obscure Sybase driver combinations is certainly needed --- diff --git a/Changes b/Changes index e40b03e..8ca5192 100644 --- a/Changes +++ b/Changes @@ -67,6 +67,7 @@ Revision history for DBIx::Class - Fix corner case of stringify-only overloaded objects being used in create()/populate() - Fix spurious warning on MSSQL cursor invalidation retries (RT#102166) + - Fix incorrect ::Storage->_ping() behavior under Sybase (RT#114214) - Fix several corner cases with Many2Many over custom relationships - Fix corner cases of C3 composition being broken on OLD_MRO (5.8.x) only: https://github.com/frioux/DBIx-Class-Helpers/issues/61 diff --git a/lib/DBIx/Class/Storage/DBI/Sybase.pm b/lib/DBIx/Class/Storage/DBI/Sybase.pm index 9072b38..9f2b84a 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase.pm @@ -76,27 +76,10 @@ sub _ping { local $dbh->{RaiseError} = 1; local $dbh->{PrintError} = 0; -# FIXME if the main connection goes stale, does opening another for this statement -# really determine anything? -# FIXME (2) THIS MAKES 0 SENSE!!! Need to test later - if ($dbh->{syb_no_child_con}) { - return dbic_internal_try { - $self->_connect->do('select 1'); - 1; - } - catch { - 0; - }; - } - - return ( - (dbic_internal_try { - $dbh->do('select 1'); - 1; - }) - ? 1 - : 0 - ); + ( dbic_internal_try { $dbh->do('select 1'); 1 } ) + ? 1 + : 0 + ; } sub _set_max_connect {