From: Peter Rabbitson Date: Tue, 14 Jul 2009 11:30:55 +0000 (+0000) Subject: Minor logic cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d36f44d86e168c1cdcd45d8ac2ced0114b1a6d4;p=dbsrgits%2FDBIx-Class-Historic.git Minor logic cleanup --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 3ffec5c..aeb6eca 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1315,9 +1315,12 @@ sub _count_subq_rs { sub _switch_to_inner_join_if_needed { my ($self, $from, $alias) = @_; + # subqueries and other oddness is naturally not supported return $from if ( ref $from ne 'ARRAY' || + @$from <= 1 + || ref $from->[0] ne 'HASH' || ! $from->[0]{-alias} @@ -1325,10 +1328,6 @@ sub _switch_to_inner_join_if_needed { $from->[0]{-alias} eq $alias ); - # this would be the case with a subquery - we'll never find - # the target as it is not in the parseable part of {from} - return $from if @$from == 1; - my $switch_branch; JOINSCAN: for my $j (@{$from}[1 .. $#$from]) {