X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FOracle%2FGeneric.pm;h=256bbc9678470827170ba56fc5964342809d4e17;hb=8273e845426f0187b4ad6c4a1b42286fa09a648f;hp=f582b943ad5a506d15ad3df5413594b610068ca2;hpb=e12571af7ad4e36930a77e2e67ca6f0e4e64ad92;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 f582b94..256bbc9 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -433,28 +433,35 @@ sub _dbi_attrs_for_bind { $attrs; } -my $dbd_loaded; sub bind_attribute_by_data_type { my ($self, $dt) = @_; - $dbd_loaded ||= do { - require DBD::Oracle; - 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.\n\nSee: https://rt.cpan.org/Public/Bug/Display.html?id=46016\n" - ); + 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; } - 1; - }; - if ($self->_is_lob_type($dt)) { return { ora_type => $self->_is_text_lob_type($dt) ? DBD::Oracle::ORA_CLOB() : DBD::Oracle::ORA_BLOB() }; } + else { + return undef; + } } # Handle blob columns in WHERE. @@ -702,7 +709,7 @@ and child rows of the hierarchy. # person me # CONNECT BY # parentid = prior persionid - + connect_by_nocycle => { parentid => 'prior personid' }