From: Henry Van Styn Date: Wed, 29 Oct 2014 13:25:33 +0000 (-0400) Subject: Fix uninitialized warnings on empty hashes passed to join/prefetch X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a7cd6baa494546f6c0716c70eac31626445d0a1f;p=dbsrgits%2FDBIx-Class-Historic.git Fix uninitialized warnings on empty hashes passed to join/prefetch (cherry-pick of 08eba48c) --- diff --git a/.mailmap b/.mailmap index 22615b3..ee01f0a 100644 --- a/.mailmap +++ b/.mailmap @@ -29,6 +29,7 @@ Gerda Shank Gianni Ceccarelli Gordon Irving Hakim Cassimally +Henry Van Styn Jason M. Mills Jonathan Chu Jose Luis Martinez diff --git a/AUTHORS b/AUTHORS index 6a9f6ef..4a56099 100644 --- a/AUTHORS +++ b/AUTHORS @@ -200,6 +200,7 @@ triode: Pete Gamache typester: Daisuke Murase uree: Oriol Soriano uwe: Uwe Voelker +vanstyn: Henry Van Styn victori: Victor Igumnov wdh: Will Hawes wesm: Wes Malone diff --git a/Changes b/Changes index df010f4..b40acf1 100644 --- a/Changes +++ b/Changes @@ -7,6 +7,9 @@ Revision history for DBIx::Class - Fix updating multiple CLOB/BLOB columns on Oracle - Fix exception on complex update/delete under a replicated setup http://lists.scsys.co.uk/pipermail/dbix-class/2015-January/011903.html + - Fix uninitialized warnings on empty hashes passed to join/prefetch + https://github.com/vanstyn/RapidApp/commit/6f41f6e48 and + http://lists.scsys.co.uk/pipermail/dbix-class/2015-February/011921.html * Misc - Remove warning about potential side effects of RT#79576 (scheduled) diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 9bc2812..e30e14c 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -3816,8 +3816,10 @@ sub _calculate_score { if (ref $b eq 'HASH') { my ($b_key) = keys %{$b}; + $b_key = '' if ! defined $b_key; if (ref $a eq 'HASH') { my ($a_key) = keys %{$a}; + $a_key = '' if ! defined $a_key; if ($a_key eq $b_key) { return (1 + $self->_calculate_score( $a->{$a_key}, $b->{$b_key} )); } else {