From: Peter Rabbitson Date: Wed, 27 Oct 2010 10:39:22 +0000 (+0200) Subject: Fix load_namespaces fail when classes tinker with $_ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5ef5fa1068d249fb353411f01a60bab5d41911c;p=dbsrgits%2FDBIx-Class-Historic.git Fix load_namespaces fail when classes tinker with $_ --- diff --git a/Changes b/Changes index 8bdefc4..9ed8f88 100644 --- a/Changes +++ b/Changes @@ -29,15 +29,17 @@ Revision history for DBIx::Class when the supplied data does not fully specify $constraint - find( col1 => $val1, col2 => $val2, ... ) is no longer supported (it has been in deprecated state for more than 4 years) + - Make sure exception_action does not allow exception-hiding + due to badly-written handlers (the mechanism was never meant + to be able to suppress exceptions) * Fixes - Fix memory leak during populate() on 5.8.x perls - Temporarily fixed 5.13.x failures (RT#58225) (perl-core fix still pending) - Fix result_soutrce_instance leaks on compose_namespace - - Make sure exception_action does not allow exception-hiding - due to badly-written handlers (the mechanism was never meant - to be able to suppress exceptions) + - Fix $_ volatility on load_namespaces (a class changing $_ + at compile time no longer causes a massive fail) - Fix find() without a key attr. choosing constraints even if some of the supplied values are NULL (RT#59219) - Fixed rels ending with me breaking subqueried limit realiasing diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 3c992ab..348edeb 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -244,7 +244,9 @@ sub load_namespaces { use warnings 'redefine'; # ensure classes are loaded and attached in inheritance order - $class->ensure_class_loaded($_) foreach(values %results); + for my $res (values %results) { + $class->ensure_class_loaded($res); + } my %inh_idx; my @subclass_last = sort { diff --git a/t/lib/DBICNSTest/Rslt/A.pm b/t/lib/DBICNSTest/Rslt/A.pm index 832500a..d02038f 100644 --- a/t/lib/DBICNSTest/Rslt/A.pm +++ b/t/lib/DBICNSTest/Rslt/A.pm @@ -2,4 +2,8 @@ package DBICNSTest::Rslt::A; use base qw/DBIx::Class::Core/; __PACKAGE__->table('a'); __PACKAGE__->add_columns('a'); + +# part of a test, do not remove +$_ = 'something completely utterly bogus'; + 1;