From de5fa1639ce1bbd683c79466e9a295e854c4ac08 Mon Sep 17 00:00:00 2001 From: Ian Beckwith Date: Sun, 3 Oct 2010 20:13:04 +0100 Subject: [PATCH] tags sql tweaks --- lib/ID3FS/DB.pm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/ID3FS/DB.pm b/lib/ID3FS/DB.pm index a9d01c7..808ff11 100644 --- a/lib/ID3FS/DB.pm +++ b/lib/ID3FS/DB.pm @@ -203,10 +203,8 @@ sub tags use Data::Dumper; print "TAGS: ", Dumper \@tags; print "VALS: ", Dumper \@tags_vals; - if(defined($parent)) - { - push(@andclauses, "( t2.parents_id=$parent )"); - } + + push(@andclauses, "( t2.parents_id=" . (defined($parent) ? $parent : "''") . " )"); if(@tags) { push(@orclauses, "( t2.parents_id='' AND t2.id NOT IN ( " . join(', ', @tags) ." ) )"); @@ -411,10 +409,7 @@ sub tags_subselect my($tag, $val)=@$pair; push(@orclauses, "( t1.parents_id=$tag AND t1.id=$val )"); } - if($parent) - { - push(@andclauses, "( t1.parents_id=$parent )"); - } +# push(@andclauses, "( t1.parents_id=" . (defined($parent) ? $parent : "''") . " )"); if(@orclauses) { push(@andclauses, join("\n\t\tOR ", @orclauses)); -- 2.11.0