From: Matt S Trout Date: Sat, 21 Sep 2019 20:15:30 +0000 (+0000) Subject: handle completely bizarre edge case X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=272cc23a2d72b08077eb88fcfb114edb32f875d6;p=scpubgit%2FQ-Branch.git handle completely bizarre edge case --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 4b4c08f..6a8abaf 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -597,7 +597,7 @@ sub _expand_hashpair { if ($k =~ /^-./) { return $self->_expand_hashpair_op($k, $v); } elsif ($k =~ /^[^\w]/i) { - my ($lhs, @rhs) = @$v; + my ($lhs, @rhs) = ref($v) eq 'ARRAY' ? @$v : $v; return $self->_expand_op( -op, [ $k, $self->expand_expr($lhs, -ident), @rhs ] ); diff --git a/t/02where.t b/t/02where.t index 1b0ac92..d1e2ee6 100644 --- a/t/02where.t +++ b/t/02where.t @@ -408,6 +408,11 @@ my @handle_tests = ( stmt => '', bind => [ ], }, + { + where => { '=' => \'bozz' }, + stmt => 'WHERE = bozz', + bind => [ ], + }, ); for my $case (@handle_tests) {