From db517cc1ff37f50a636a89f6adaba51552bbccb1 Mon Sep 17 00:00:00 2001 From: Ian Beckwith Date: Mon, 18 Oct 2010 13:49:39 +0100 Subject: [PATCH] stop special-casing /NOT --- lib/ID3FS/Path.pm | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/lib/ID3FS/Path.pm b/lib/ID3FS/Path.pm index aa2e62e..7909a97 100644 --- a/lib/ID3FS/Path.pm +++ b/lib/ID3FS/Path.pm @@ -136,7 +136,6 @@ sub parse my @parts=@{$self->{components}}; my($tag, $tagval); $self->{elements}=[]; - $self->{bare_not}=0; $self->{in_all}=0; my $root_not=0; my $tags_seen=0; @@ -336,11 +335,6 @@ sub parse } } - if($root_not && ($tags_seen < 2)) - { - $self->{bare_not}=1; - } - # remove trailing boolean my @elements=@{$self->{elements}}; while(@elements && $self->is("boolean", $elements[$#elements])) @@ -707,12 +701,6 @@ sub tags_subselect { my($self)=@_; my $hasvals=$self->expecting_values(); - # we need to specially handle a bare /NOT/tag with no other clauses, - # using a simple WHERE id !='tagid' instead of a LEFT JOIN - if($self->{bare_not}) - { - return $self->bare_not_subselect(); - } if($self->{in_all}) { return "\tSELECT id FROM files AS files_id\n"; @@ -760,27 +748,6 @@ sub tags_subselect return $sql; } -sub bare_not_subselect -{ - my($self)=@_; - my @tags=grep { $self->is("tag", $_); } @{$self->{elements}}; - my $sql=("\tSELECT f1.id AS files_id FROM files f1 WHERE f1.id NOT IN (\n" . - "\t\tSELECT fxt1.files_id FROM tags t1\n" . - "\t\tINNER JOIN files_x_tags fxt1 ON t1.id=fxt1.tags_id\n" . - "\t\tWHERE "); - if(scalar(@tags) > 1) - { - $sql .= ("(t1.parents_id='" . $tags[0]->id() . "' AND t1.id='" . - $tags[1]->id() . "')"); - } - else - { - $sql .= ("(t1.parents_id='' AND t1.id='" . $tags[0]->id() . "')"); - } - $sql .= "\n\t\tGROUP BY fxt1.files_id\n\t)\n"; - return($sql); -} - sub sql_start { my($self, $tables)=@_; -- 2.11.0