From: Matt S Trout Date: Thu, 4 Aug 2005 15:09:04 +0000 (+0000) Subject: Overrode part of ContextualFetch in ImaDBI to shut up the useless warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aea8af718bc966c6ca437015005022e20c913732;p=dbsrgits%2FDBIx-Class-Historic.git Overrode part of ContextualFetch in ImaDBI to shut up the useless warnings --- diff --git a/lib/DBIx/Class/CDBICompat/ImaDBI.pm b/lib/DBIx/Class/CDBICompat/ImaDBI.pm index 8aaa564..08a72d8 100644 --- a/lib/DBIx/Class/CDBICompat/ImaDBI.pm +++ b/lib/DBIx/Class/CDBICompat/ImaDBI.pm @@ -2,6 +2,7 @@ package DBIx::Class::CDBICompat::ImaDBI; use strict; use warnings; +use DBIx::ContextualFetch; use NEXT; use base qw/Class::Data::Inheritable/; @@ -99,4 +100,21 @@ sub transform_sql { return sprintf($sql, @args); } +package DBIx::ContextualFetch::st; + +no warnings 'redefine'; + +sub _untaint_execute { + my $sth = shift; + my $old_value = $sth->{Taint}; + $sth->{Taint} = 0; + my $ret; + { + no warnings 'uninitialized'; + $ret = $sth->SUPER::execute(@_); + } + $sth->{Taint} = $old_value; + return $ret; +} + 1; diff --git a/t/cdbi-t/02-Film.t b/t/cdbi-t/02-Film.t index ca0a004..ffccecd 100644 --- a/t/cdbi-t/02-Film.t +++ b/t/cdbi-t/02-Film.t @@ -228,10 +228,7 @@ is($btaste->Director, $orig_director, 'discard_changes()'); my $btaste2 = Film->retrieve($btaste->id); $btaste->NumExplodingSheep(18); my @warnings; - local $SIG{__WARN__} = sub { - unless ($_[0] =~ m/ContextualFetch/) { - push(@warnings, @_); - } }; + local $SIG{__WARN__} = sub { push(@warnings, @_); }; { # unhook from live object cache, so next one is not from cache