X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2FID3FS%2FPath%2FNode.pm;h=6254600e5a87742970a2bb3117063c57238036e9;hb=c8571ddb3cc1f9bce16c91838de17f27242d2f32;hp=774af3afd301323e4ff96bd7d2985bdd9716adbe;hpb=587ca27b2f5f96b35fb077f98b6806409aa9d709;p=id3fs.git diff --git a/lib/ID3FS/Path/Node.pm b/lib/ID3FS/Path/Node.pm index 774af3a..6254600 100644 --- a/lib/ID3FS/Path/Node.pm +++ b/lib/ID3FS/Path/Node.pm @@ -82,7 +82,7 @@ sub to_sql $str .= "t" . scalar(@joins) . ".id='" . $self->{id} . "'"; if($not && !$hasvals) { - $str .= " AND fxt" . scalar(@joins) . ".files_id IS NULL"; + $str = "(" . $str . " AND fxt" . scalar(@joins) . ".files_id IS NULL)"; } return ($str, @outjoins); } @@ -150,7 +150,7 @@ sub to_sql $str=$leftstr; $str .= " $op " if($op && !$not); $str .= $rightstr; - if($op || ($left && $right)) + if($op && $left && $right) { $str="(" . $str . ")"; }