X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=30a9f54f3ac2f3af0d747712f6155b2763572f34;hb=ddcc02d14;hp=636e40e168a3a06135a118f0f4b42171fb72cdb4;hpb=74113bd1f2506a481f7938d8f55ecbde5d742c6e;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index 636e40e..30a9f54 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -7,8 +7,8 @@ use mro 'c3'; use DBIx::Class::Carp; use Scope::Guard (); use Context::Preserve 'preserve_context'; -use Try::Tiny; use List::Util 'first'; +use DBIx::Class::_Util qw( modver_gt_or_eq_and_lt dbic_internal_try ); use namespace::clean; __PACKAGE__->sql_limit_dialect ('RowNum'); @@ -272,12 +272,13 @@ sub _ping { local $dbh->{RaiseError} = 1; local $dbh->{PrintError} = 0; - return try { + ( dbic_internal_try { $dbh->do('select 1 from dual'); 1; - } catch { - 0; - }; + }) + ? 1 + : 0 + ; } sub _dbh_execute { @@ -422,6 +423,7 @@ sub _dbi_attrs_for_bind { # Push the column name into all bind attrs, make sure to *NOT* write into # the existing $attrs->[$idx]{..} hashref, as it is cached by the call to # next::method above. + # FIXME - this code will go away when the LobWriter refactor lands $attrs->[$_] and keys %{ $attrs->[$_] } @@ -439,20 +441,11 @@ sub bind_attribute_by_data_type { if ($self->_is_lob_type($dt)) { - # this is a hot-ish codepath, store an escape-flag in the DBD namespace, so that - # things like Class::Unload work (unlikely but possible) - unless ($DBD::Oracle::__DBIC_DBD_VERSION_CHECK_OK__) { - - # no earlier - no later - if ($DBD::Oracle::VERSION eq '1.23') { - $self->throw_exception( - "BLOB/CLOB support in DBD::Oracle == 1.23 is broken, use an earlier or later ". - "version (https://rt.cpan.org/Public/Bug/Display.html?id=46016)" - ); - } - - $DBD::Oracle::__DBIC_DBD_VERSION_CHECK_OK__ = 1; - } + # no earlier - no later + $self->throw_exception( + "BLOB/CLOB support in DBD::Oracle == 1.23 is broken, use an earlier or later " + . "version (https://rt.cpan.org/Public/Bug/Display.html?id=46016)" + ) if modver_gt_or_eq_and_lt( 'DBD::Oracle', '1.23', '1.24' ); return { ora_type => $self->_is_text_lob_type($dt)