From: Nigel Metheringham Date: Fri, 14 May 2010 15:01:19 +0000 (+0000) Subject: Added check for defined to str equality test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=718d7732a02fd3bc3e20c0dda439d52b817b6188;p=scpubgit%2FQ-Branch.git Added check for defined to str equality test --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 610da72..3863425 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -484,7 +484,7 @@ sub _where_HASHREF { else { $self->debug("Generic unary OP: $k - recursing as function"); my ($sql, @bind) = $self->_where_func_generic ($op, $v); - $sql = "($sql)" unless $self->{_nested_func_lhs} eq $k; # top level vs nested + $sql = "($sql)" unless (defined($self->{_nested_func_lhs}) && ($self->{_nested_func_lhs} eq $k)); # top level vs nested ($sql, @bind); } }