From: Peter Rabbitson Date: Tue, 28 Apr 2009 21:01:46 +0000 (+0000) Subject: Revert r5976, trying something better X-Git-Tag: v1.70~169^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5e1d09d56ff8ada8e122ef7055a27e10de25e665;p=dbsrgits%2FSQL-Abstract.git Revert r5976, trying something better --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 5b901b0..24a1c87 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -360,13 +360,11 @@ sub _recurse_where { sub _where_ARRAYREF { - my ($self, $where, $_logic) = @_; + my ($self, $where, $logic) = @_; - my $logic = uc($_logic || $self->{logic}); + $logic = uc($logic || $self->{logic}); $logic eq 'AND' or $logic eq 'OR' or puke "unknown logic: $logic"; - my $orig_logic = $self->{logic}; - my @clauses = @$where; my (@sql_clauses, @all_bind); @@ -401,7 +399,6 @@ sub _where_ARRAYREF { push @all_bind, @bind; } } - $logic = $self->{logic} if $orig_logic ne $self->{logic} and !$_logic; return $self->_join_sql_clauses($logic, \@sql_clauses, \@all_bind); } @@ -587,11 +584,6 @@ sub _where_hashpair_HASHREF { }, FALLBACK => sub { # CASE: col => {op => $scalar} - if ($val =~ /^ - ( AND|OR ) $/ix) { - $self->{logic} = uc $1; - delete $v->{$op}; - return '', (); - } $sql = join ' ', $self->_convert($self->_quote($k)), $self->_sqlcase($op), $self->_convert('?');