From: Dagfinn Ilmari Mannsåker Date: Wed, 20 Apr 2016 16:20:26 +0000 (+0100) Subject: Fix Oracle _dbh_execute_for_fetch warning suppression X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b731f1eca0005daa869c61a96e48434af5635dc;p=dbsrgits%2FDBIx-Class-Historic.git Fix Oracle _dbh_execute_for_fetch warning suppression Commit 52cef7e3 changed from using execute_array to execute_for_fetch, but didn't update the signature of the override in Storage::DBI::Oracle::Generic, so it was setting ->{PrintWarn} 0 on the result source, not the statement handle. The reason it was not detected since is that DBD::Oracle 1.28+ already fixed the underlying warning. --- diff --git a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm index b196b80..838c8da 100644 --- a/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm +++ b/lib/DBIx/Class/Storage/DBI/Oracle/Generic.pm @@ -7,7 +7,7 @@ use mro 'c3'; use DBIx::Class::Carp; use Scope::Guard (); use Context::Preserve 'preserve_context'; -use DBIx::Class::_Util qw( modver_gt_or_eq_and_lt dbic_internal_try ); +use DBIx::Class::_Util qw( modver_gt_or_eq modver_gt_or_eq_and_lt dbic_internal_try ); use namespace::clean; __PACKAGE__->sql_limit_dialect ('RowNum'); @@ -325,10 +325,12 @@ sub _dbh_execute { } sub _dbh_execute_for_fetch { - #my ($self, $sth, $tuple_status, @extra) = @_; + #my ($self, $source, $sth, $proto_bind, $cols, $data) = @_; - # DBD::Oracle warns loudly on partial execute_for_fetch failures - local $_[1]->{PrintWarn} = 0; + # Older DBD::Oracle warns loudly on partial execute_for_fetch failures + # before https://metacpan.org/source/PYTHIAN/DBD-Oracle-1.28/Changes#L7-9 + local $_[2]->{PrintWarn} = 0 + unless modver_gt_or_eq( 'DBD::Oracle', '1.28' ); shift->next::method(@_); }